At my bariatric center's monthly support group meetings we devoted a whole session to this very thing. Fortunately that was the session my friend and main support person attended. What we discussed was rather than making the compliment about looking good/more attractive (because as you pointed out, a lot of us then can't help but think - gee I guess you are saying I really looked awful before), to make the compliment more about accomplishments such as "I can tell you've really been working hard" or "I can see you have so much more energy now" or in my case as my friend points out to me "You are so much more active now. I am so happy to be able to see your journey"
But I will say, it is nice to hear something, anything, that says the transformation is noticeable. I was over a hundred lbs down before anyone ever said anything - not even my close friends that knew about the surgery. I commented one day to one of them that it was frustrating to have lost a big chunk of weight and no one notices. She actually said everyone notices but I know I wasn't sure how to phrase it and also, it was so obvious that you had lost a lot that I just assumed you realized too how much your appearance was changing.
So there is a fine line between it being a veiled insult and a welcome acknowledgement. And during that emotional initial phase - I know I never know how I'll react to even the most innocent of comments. So kudos to the friends that take the risk and talk to you about your progress.