Laws on this vary considerably, from nation to nation and even between states in the USA. Let me give you an example though. If you were born "male" and transition to female, in MOST states you could marry a man. In some states you could marry a woman. Of course, we need to define "transition." Living and being accepted as female, for example, does not mean you are legally female in many jurisdiction. I once had two clients, a post op TS lady and a pre op TS lady. They wanted to get married. In California this is legal, although I had to send a letter explaining things to the county clerk in their home county. The first try for a marriage license was turned down because there was no way that the licensing clerk was going to let two women get married!! They got the license on the second try.
I hope this helps.