I did this when I left Apple; it seemed a lot harder until the moment I walked into his office and had the conversation. It helped that I wasn't leaving because of problems with him or the culture, but rather to strike out on my own. He and my grandboss were very understanding. Be prepared to as you say spend the energy bringing someone new up to speed, but don't knock yourself out over it, because a) that's your boss' responsibility and b) you'll never get it 100% right in any reasonable amount of time.
Too, cut the cord. Don't offer to contract or help out on an informal or even formal basis. You are going to need to concentrate 100% on your new gig; they are going to need to get someone up to speed; delaying this process is in nobody's best interest.
Good luck! It sounds like you have the right attitude already, which will go a long way towards smoothing the process.
EDIT: Oh, and be sure to set a definitive end date. That will focus attention on the problem of replacement. Be reasonable (e.g., not so much the "I've already packed and there's a helicopter outside"), but firm.