There is actually a trans character in "Live by the Code", who technically is a canonical character (just not canoically trans). Morgan Kelly is described as "having been a "he", at least physically" before and during the Romulan War, and refers to her having had a "sex change".
I am not too fond of the terminology used. (I should note that I'm reading the German edition of the book, so maybe it's better in the original). The whole idea that she was a "physical he" kinda leads the way to misgendering trans people based on the state of their medical transition. I generally don't like the term sex change, as sex and genitals aren't exclusively the same things, and people usually mean genital reassignment surgery when they say sex change, but since this is the future, I guess it could be possible to also change chromosomes and gonads, so I'm inclined to let it slide.
The book was written by a cis writer, so yeah. He also uses some other not great terminology in his annotations, which again, I'm not a fan of. That all being said, I've seen him be a trans ally time and again on this board, and it's been a few years since this book came out, so I'm sure he's since changed some of his terminology and is be generally open to do so. So, I'm not throwing shade or anything. At least we have a trans character at all.