It's very difficult but possible.
I'm an endo-mesomorph, easy gainer. I can add mass relatively easily, not all lean of course, but is difficult for me to burn off the fat. I have to keep tabs on the lean mass I gain along with the muscle mass, because it's far too easy for me to gain too much fat. I just finished a gaining cycle, certainly looking soft around the edges, now starting to concentrate on cutting the fat for a few weeks.
Eating very clean along with the proper workout program can yield you a higher lean mass gain with very little fat gain, to keep pretty lean, though you may lose a little definition, it wouldn't take as much at the end of your mass gain cycle to get truly ripped again. Working with a RDA can help you with your specific goal of keeping lean during bulking.