.".How can we really tell that Jack is changing unselfishly?"----T. Maria
I think about that sometimes when I'm with my fiance. If I'm kind of down I think, "we're just with each other because it makes us happy, and that's a selfish reason," but then I remember something someone once told me. "Love isn't how someone makes you feel. It's about how you make them feel."
Love is finding joy (which is more complete and lasting than happiness) in acting selflessly for someone else, doing what you can to make their life richer, better, more fun, safer, whatever.
So you can try to apply that here. Something is after Jack during this whole movie: Davy's Kracken. He's got a lot at stake this movie, when before, he was just trying to get back his ship. He was pretty unselfish in that one because there were at least two opportunities where he could have let Barbosa kill Will and still get back his ship, but he wasn't going to hurt anyone but Barbosa to get it back.
Fast forward and now Liz is with him on the Pearl. He's acting pretty neutral with her, just playful flirting. Then when they find the chest, he acts very selfishly and even bails out on his Pearl. But he comes back. Why?
He wouldn't have had his Pearl, but he would have been alive. But he took out his compass and where did it point? Back to the ship and the people on it. The right thing to do was help them even if it meant his own life. That's far from selfish. That's a downright sacrifice. So imo, Jack will always be kind of a scoundrel, but he has a heart under all that, and he's not above letting the good in him come out when it needs to.