There's a lot of great advice here already, so I'm not going to reitreate. Instead, I'm going to offer an anecdote:
My egg cracked 11 years ago. At the time, my spouse and I had been married for 5 years and together for 10. They meant the world to me and were the only thing driving me every day. I always said that my career was second; they were the smarter one (higher academic degree, more published papers, more detailed mathematical work) and so I could pick up anywhere and do whatever as long as they were doing what they wanted. I would then and would still, now, gladly take a bullet to keep them safe.
I put this out there to lay the foundation for my decision when I discovered, cognitively, that I was transfemme. My immediate and lasting reaction was to shove that in a box and bury it. I refused to harm our relationship or my spouse in ANY way, including but not limited to: socially, emotionally, economically, physically. I was thinking about the direct and indirect effects on them from knowing, and dealing with, me, my transition, or the way others would react to it with them or to them.
I missed a very important factor in all of this: me. Forgetting, just for a moment, how miserable it is to live through over a decade of dysphoria without help or even a verbal outlet, I harmed my spouse by being absent from life in general. I was always stuck inside my own head thinking about how life could be instead of how it was at the moment. After I came out, received a diagnosis and eventually began HRT, they told me they could tell I was actually with them again. I was there. Physically, sure, but also mentally! I was aware in full of the world and events around me and actively taking part in life again.
Did I do some damage? Yes. Some of it is yet to be realized, since I still fully pass in boymode and am sticking to that in public for quite some time. The difference is that the issues we face now and will face in the future are ones we'll face together. I won't face them alone inside my head and they won't face them without me really being in the moment. We're actually a couple again, everyday, and I wouldn't give this up for anything.
I have one regret. I regret not doing this a decade ago.
One thing I wanted to mention but didn't: I wrote this to show that it could be possible to be you and be in a loving relationship. They don't all have to end just because of a change. My spouse and I still love each other as much as the day we met. I'm starting thereapy to work through my transition, and at some point I will bring them in for a couples session (or as many as we need!) to make sure we are both doing the things that are right for us. I'd love to remain in this marriage the rest of my life. I hope they do as well, but if there are needs I can no longer fulfill or the attraction isn't there anymore, I'm willing to accept that. Life was never fair (I'd have been born with two X chromosomes if it was!) and I know that changes can come and that some can be worse than others. For now though, I have a trusted partner, best friend, and loving spouse to help me through it, all in the same person.