How to get letter of recommendation from current advisor if transferring PhD to another university for family reasons?
If your advisor is generally an emotionally sane person, he should be able to understand your position. If your advisor is not, you're better off finding out as early as possible, and then to run.

That said, the right time to talk to your supervisor is right now, for two primary reasons:


As you're working in a lab, it is quite likely that your supervisor would want to hire a replacement for you, which takes time.
Your supervisor may have contacts to the relevant universities, and be able to help you moving.


When it comes to what to talk about, there are two important aspects besides your wish to be closer to your family:


You'll want to reassure him that you are not leaving unfinished things around. Wrap up your experiments as far as possible before you leave, and be available to work on manuscripts after you're gone, too.
Do you plan to take your thesis topic with you? If so, you probably should discuss intellectual ownership with your advisor. Even if you feel it was your idea, he may disagree.


Finally, is there any risk that your current lab has some "secret techniques" that you'd "hand over" to the competition? If so, try to address potential concerns.