At a recent shul kiddush on shabbat I witnessed someone perform a melacha seemingly on purpose two or three times. It was clear to me that this person was unaware of a certain halacha. I did not know this person and I was in a public setting so I was uncomfortable to go over to him and explain what he was doing violated halacha.
I'm sure socially awkward situations like this happen all the time.
Based on the principle that all Jews are guarantors for one another I understand that I should simply go and tell a person when I see him or her doing something that violates halacha, but in practice, in my experience, I don't see that happening very often.
What is some good advice on how to overcome the social awkwardness around correcting someone's behavior? Please only cite examples that you have personally seen/used successfully or reliable sources.
Note I am only asking about correcting a mistaken or inadvertent transgression, not rebuking someone