It's great that people here are being supportive of you but I'd like to be a bit more realistic with you.
I agree that you should find yourself and, when you are sure, embrace who you are and do what you must do to become that. But as you say you love your boyfriend and it's not so simple to just "lose him because reasons."
First off, if you find the need for a sex change I have nothing against that. It's entirely up to you what you do with your life. I want to point out right away that I personally do not understand it, but I fully support the individual choices of every person. Still, I strongly suggest that you wait until you are at least in your mid twenties to be absolutely certain it's not a phase. A sex change is difficult to reverse and the years you spend making sure are generally really well spent to make avoid regretting it later on.
A bit of info from a heterosexual guy:
most heterosexual men find it impossible be in a relationship with a person with a male body regardless of how they identify. Call it what you want but that is reality. While I'm sure your boyfriend loves you with all his heart, instinct and societal norms influence all of us; even if your boyfriend happens to be immune to social constructs, as long as he is heterosexual his instinct will scream for him to not be with someone with a male body. Best case scenario you will remain friends; the alternative is he forces himself to be with someone that he fundamentally feels he shouldn't be with and that would be undesirable for both of you. Please bear in mind there is a huge difference between love and the physical feeling of attraction/repulsion.
If a heterosexual man loves a woman he is likely to be "in love." If a heterosexual guy loves a man he is likely to be "a bro." Regardless of all the new-age crap about gender identity, humans are still extremely primitive when it comes to uniting emotions and physical attraction, and to demand otherwise is either utopic or plain stupid.
I personally know a heterosexual couple who split up because she decided she needed a sex change. He was devastated but in the end he accepted it and they remained friends although they could no longer be a couple. My point is, if you decide you need to go through with it you will have to accept that it is going to have serious implications on your boyfriend and it is extremely unlikely that he will remain your boyfriend. Every instinct in a heterosexual guy would be screaming for him to leave the relationsiup and to pressure him into doing otherwise is just as cruel as pressuring a gay man into a heterosexual relationship - if not worse since his peers will judge him heavily for it.
In the end this is my point:
If you find that you need to have a sex change to feel comfortable about yourself then I think you should have one. But don't expect your boyfriend to stick around; at best he will remain your friend (and he may be a valuable one, seeing as he hasn't left you at the thought of you considering a sex change). But please, please, please make sure that you are absolutely certain before you make a life-altering decision like that. While your sexual identity seems paramount in your teens it tends to become less so when you enter adulthood, and there is ample time to make such decision later on.
But you must prepare yourself that any heterosexual boyfriend you have is not likely to remain your boyfriend if/when you go through with it, and please do your utmost to not judge him for it; it's no more his fault than it is your fault to need a sex change.
I wish you the best! I hope it all turns out well for you.