To provide an alternate perspective, I disclose only when that information is relevant to the care I'm seeking. My optometrist and dentist have no idea I'm trans even though I started seeing them when I was pre-T, because quite simply, I don't feel they need to know. That aspect of my medical history has nothing to do with my eyes or teeth.
However, my GP, dermatologist, and of course endocrinologist are all aware of my status since it directly affects the care they give and provides important context. If I had to hit up the ER, I'd absolutely let them know as well. But I don't think medical professionals across the board necessarily HAVE to know.