Hey there! I'm thinking about studying in Sweden, too. I don't know what country you hold citizenship in, so I might not be of much help. If you go to study in Sweden, you will be going there on a residence permit. This allows you access the same healthcare citizens can get while you study IF your program is longer than one year--however, if it is less than one year, your university may offer a healthcare program. Side note, dental is free until you're 19 or 20, and it can get expensive. I recommend flossing.
If you're from the EU/EEA/Switzerland, you'll get an EHIC card.
In terms of health care for transgender people, I found a paper for the University of Gothenburg that states that services for transgender people (referring to treatment in terms of hormones and surgeries) are indeed covered by Sweden's health insurance.
Some things about university: depending on what university you go to and what nation and region you are from, university in Sweden might not be free. If you are not a citizen of the EU/EEA/Nordic countries or Switzerland, you will have to pay tuition for degrees at a bachelor's or master's level. Also, Sweden requires you to have 8,010 SEK per month for 10 months, along with proof of that. Keep in mind fees for textbooks and Sweden's student union fees. Tuition tends to start around 80,000 and often ends around 120-150,000 SEK.
I don't say this to discourage you or anything, just figured it would be good to let you know. Don't forget about scholarships and loans, either. And keep in mind that classes in the Swedish language are cheaper and more plentiful than classes in English.
No matter where you study, I hope it all works out!