But there's a huge difference between homosexuality (= same-sex attraction) and trans (= changing sex). We can explain this in an 'all about the feels' way ...
-- Suppose a man sincerely says he feels attracted to men. Since to feel attracted is to be attracted, what he says must be true. (He's sincere, we're assuming, remember.)
-- Suppose, on the other hand, a man sincerely says he feels he has changed sex (and is now a woman). Since it is impossible to change sex, what he says must be false. (Even given he's sincere.)
It's not a mental illness to be same-sex attracted. It's just to feel attracted to people of the same sex. Nothing wrong with that feeling.
You may not need to be mentally ill to honestly feel you have changed sex. But you are at best mistaken if you do feel that. Something is wrong with this latter feeling in that it gets things wrong.