Some examples to help jj1967:
If a child told a teacher I think I might be trans and they have a chat about it, the child said they were quite happy not doing about this at present they were just sharing some thoughts about their identity exploration - no safeguarding risk no need to share with parents. But you'd monitor.
If a child said they were trans were deeply unhappy because they could not be open about this due to their parents response. School would discuss with safeguarding lead and make a decision on next steps with outside agency advice. Might be to monitor with the child, or be to discuss with parents (with child's knowledge) as child's mental health deterioration makes it safeguarding, again with outside agency and then monitor.
If a child is wanting to socially transition in school but not tell parents, school would need to consider seriously why they would not involve parents, and if this is due to fear of parental reaction, then that is safeguarding and outside agency involvement.
For what reasons can you offer school would not involve parents? If school are concerned about how parents might treat a child they have to involve parents to address this, not collude in keeping a secret.
The idea that the best strategy is for the school to collude in helping a child lead a double life is an insane type of safeguarding i.e. not safeguarding at all.
The comparison with gay, is that if there are no safeguarding concerns around sexual activity or mental health then it is a private matter for the child, not safeguarding, and does not need to be shared. Although you'd keep an eye on this to ensure safeguarding concerns do not arise.
Safeguarding means things cease to be private and need to be shared and parents have to then be involved.