Obviously there is no one, definitive 'best way' for this. Personally, I would tell them as soon as you feel able/comfortable to do so. I can't imagine how you could possibly shield them from it completely, and even if you did, it would probably not be a very healthy or happy situation for you - constantly hiding who you are from your loved ones. Waiting to tell them until you have a diagnosis or until you are are about to make any major changes to your presentation (the way you dress, going by a different name, hormone therapy, etc) could result in your family feeling that you have made a quick, or even rash, decision, as they were not part of, or aware of the process and struggle you have been going through coming to this decision. If you can find a way to attempt to explain how you feel now, and the steps you are taking, or planning to take, it may help them to feel more included in the process and to not feel that you have just suddenly sprung this huge thing on them or that you have suddenly undergone an identity change.
Best of luck with your family, for me personally, 'coming out' can be a bit of a never ending process and I don't think there is any "one size fits all" approach to it.