wantstorepair,
Here's the thing. Thinking about others isn't really a "goal" or a "thing you do". It's actually something most of us do very naturally. I think most WS's have just forgotten that. For many of us (it was for me!) it is common (after infidelity) to hear our spouse and others tell us constantly that we are selfish and think of no one but ourselves. Which is usually true. The problem with that is, we start to absorb those words as an identity, as a character flaw, rather than what it really is, which is something we currently do. I know this is confusing, so let me give you an example of what I mean.
Let's say you are walking down the street, and a child is walking in front of you. Suddenly, the child trips and falls, and you can see they scraped up their knees and hands enough to need a band-aid. How do you react to this?
1) You step on the child as you continue walking
2) You step over the child as you continue walking
3) You stop and help the child up, kiss their boo-boo, and give them a band-aid
Unless you are a complete psychopath, I'll assume you went with #3. But why? Who told you to help the child up? What motivated you to kiss their injury? What benefit did you get from reacting as you did?
The problem isn't that "you are completely broken". Nor are you incapable of empathy, kindness or lack the ability to think of others. If you saw someone get hurt, you'd help them. If you hurt someone else (e.g. the baseball you just hit broke their window) you'd own it (buy them a new window). So the problem isn't your ability to care or think of others. Do you agree?
If so, then what's the actual problem here? Well, it seems to me that your lack of empathy is fairly localized. In other words, your selfishness shows up when the topic is related to infidelity, and/or to your spouse who you cheated on. So the problem isn't that you are incapable or lacking in empathy, it's that you lack empathy "when it comes to the affair and to your spouse". It's specific. It's quantifiable. And therefore, it's addressable.
Why were you able to show kindness to the child? Well, for one thing, you didn't cause their pain. You didn't kick or push the child, you didn't trip them, and you didn't point and laugh when they fell. You also didn't lie to or gas-light them, such as tripping them but then telling them that didn't actually happen. There was no reason in this case to feel shame, or blame, or remorse, or label yourself in an unflattering way. So there was no barrier for you to overcome when showing kindness to the child.
But when it comes to the infidelity, you did all those things (and when I say "you", I mean all WS's, myself included). Intentionally taking actions that harm another (whether harm was the goal or not), lying and gas-lighting, living a double life and doing things that you are not proud of... doesn't make anyone happy. It doesn't feel good to be that person. But we don't know how else to feel. I mean, how do you feel good about yourself when you just decimated the lives of others?
So here's my answer to your question. You think of others, not by white-knuckling it and forcing yourself to do so, but by removing the barriers that are keeping you from doing so in the first place. You may want to drive a car, but if you lack a license, it will prevent you from doing so, regardless of your ability to drive. You may want to be empathetic and think of others, but if you allow yourself to wallow in shame instead, then that prevents you from thinking of others, and forces you to think of yourself instead. (If you think deeply about it, the mere fact that you are planning ways to appear empathetic is in itself, selfish. It's an attempt to manipulate others into seeing you as a good person, rather than actually just being a good person. Manipulating others so you'll look better in their eyes is about you, not them. It's about what you want, not what they want.)
You have to get out of the shame spiral. You have to stop viewing yourself as someone who is not even capable of empathy. You have to accept, BUT NOT SELF-IDENTIFY, as someone who did a bad thing that they regret, and just own that behavior and those choices, rather than become them. In the same way that you pay for the broken window and then plan to hit your baseballs in another direction next time, with infidelity, you look for ways to make amends for the harm you caused, and then you do better moving forward.
In plain English, what I'm trying to say is... you open the door to thinking of others by removing the need to think of yourself. You remove the need to think of yourself by owning your choices and taking steps to be a better person from now on. Most of all, and I cannot stress this enough, you have to learn to love yourself, flaws and all. If you love yourself, then you don't need approval from your spouse or anyone else to realize that you are worthy of giving and receiving love. And if you don't waste all your energy seeking approval, then you'll find you have tons of bandwidth for empathy to occur and exist.