Not all branches are as bad as the others. In more than 4 years in the Air Force, I never really saw anything really bad. Granted people started asking questions about me, but it wouldn't have gone anywhere but my shop. Most there had a live and let live yet still family approach to things.
It's been shown that there is more LGBT in the military per capita than the general population. So why are they not fighting? It's not just a bad idea to fight from the inside (the military has too much control over your life, the military is not a democracy), but mainly, most of them are there trying to make their life work in a non-trans, hetero form. They are trying to fix themselves. Being homophobic/transphobic can come with the territory. Look at all the politicians who vote and preach against it, then get nailed in gay encounters.
Do not go telling your commander that you are TG. That's a VERY bad idea.
First off he may not believe you, and word may spread. Neither of which you want. If he does believe you, it may not be any better. There are few secrets in the military among it's members. Who has aids, who slept with who... It gets around fast.
Second. If they do believe you, they can charge you with lying to get in. They rarely ever press this, but it is there. False pretenses probably would cover it. Then there is the discharge itself. It WILL stay with you. Forget stealth. Also, they will drag their feet getting rid of you. You could be on special duty, and getting the worst jobs around for the next 6 months or more. 4-6 month discharges were not uncommon. You are manpower, and they need crap jobs done. You aren't there for the right reasons so why should they be in a hurry to help you get out. In contrast someone who is injured can be on the way home in a week.
If you want to get out under this, I have heard that the best way is to talk to a therapist. This way you have some footing when you get to the point of dealing with your commander. The therapist may be able to get you discharged under different circumstances and maybe give you something for dealing with the any anxiety. The military is all about paperwork. Make sure you have yours in order before going to your commander.
Best advice though, is if you can just get through it, do it.
Pocket as much cash as you can while you are there.
My thanks to those serving and have served.