Physical health is one of the most challenging issues in a relationship. It's not usually listed in the surveys as one of the top reasons why couples fight, but I believe it's because most couples are too ashamed to actually talk (or fight) about it.
Having an unhealthy partner, whether it's due to substance abuse or severe obesity or anything else, is very hard. You want them to get healthier, and are often frustrated as to why they're not. In your mind, you see their lack of effort as a choice, so much of the motivation that you're providing is probably along that line. "Let's go to the gym together." "Let's get a healthy cookbook and start cooking." In the mind of the partner, all it comes down to is giving them the right push.
But you can't push someone to do something like lose weight or kick drugs. That push feels like pressure, and that pressure creates shame, and that shame leads to more unhealthiness. If your boyfriend is going to change, that push is going to have to come from him. So my advice for you isn't about what to do for him. It's about what to do for yourself.
You need to honestly assess whether or not you can be with your boyfriend long term if he doesn't become healthier. Could you spend the next years and decades with an unhappy sex life? Is his stubbornness a constant source of frustration? Do you feel waves of guilt and shame? If the answers to those questions aren't happy ones, then I think you should consider moving on.
And if you do, I recommend you be honest with him as to why. Don't spare his feelings here, because perhaps hearing what caused the break up is enough for him to generate his own push. Everything you've done so far isn't enough. He isn't creating his own motivation. Perhaps the shock of losing his girlfriend because of his weight will let him put together that push.
I wish him, and you, a lot of luck.
Ladies, am I wrong? Have you been able to talk a boyfriend or girlfriend into getting healthy after they've refused to for a long time? If so, how did you do it?