Yeah what game has left the biggest impression as doing that kind of thing best.
For me, I would probably say inFamous 1 & 2. The whole setup, of me being trapped in this city, and having the power to help elevate everyone from the tragedy we were all stuck in, and to see those actions having a direct effect. It was a combination of a lot of little things for me. Especially in the first game, but, it was really neat how it was set up. How I could use my powers in each section of the city, to restore power, and thus expand my power reach, but to do so, meant going in to fight in an area that had no electricity, thus putting me at a disadvantage at first. Having my actions of helping the people, slowly changing their opinion of me. Going from them yelling at me in hatred when I first start, and they blame me for the tragedy, to just sort of waving and being like "Hey Cole, what's up?" to eventually taking selfies of me if I happen to be near them on the street, and even calling a friend and fangirling about it right after. Having the sections of the city showing less rubble, and showing lights and electricity again as I restore the power and a sense of normalcy. Random people coming up to me and asking for my help, pointing me to a nearby person in distress that I could heal. Eventually getting to the point where they cheer me as a hero as I zip by on my electro feet, and actively help me fight off the badguys when I ran into fights.
The way the city reacted to you had such a fun impact on me. I genuinely felt like I was improving things, it wasn't just window dressing. I remember one time, the citizens all ganged up on a group of thugs, and literally stoned them to death on my behalf. Like a dozen of them, all hurling rocks at such a rate that it was like a machine gun, and the badguys had no chance to really fight back. I literally just sat back and watched them defend me and their own neighborhood, and then cheer at their victory.
Another time, a random Good Samaritan called for my help, and led me over to a person who was on the ground in pain. I went into the healing animation, which once triggered, you lose all control of the character for a few moments. The camera happened to be angled where I could see a nearby rooftop, and saw a figure up there. Only badguys are on the roofs, so I was aware it was a thug. He proceeds to shoot at me while I'm healing, but instead of hitting me (which really wouldn't have been much of a threat at that point), instead, his shot, hit and killed the Good Samaritan standing next to me, watching me heal the guy he led me to. I was helpless to stop it, and it genuinely pissed me off. So much so, that I hunted that dude down, and did the "life drain" evil attack on him. Because fuck that guy.
that's probably the most personal example of what you are asking. It's hard to say really though, as I've played so many games in the 35ish years I've been gaming, they all sort of blur together with time. But that one really sticks out. Those 2 games, are in my Favorite Of All Time list.
InFamous 2 did more of the same, with a few improvements here and there. And then the ending, where you have to make the choice on how you will proceed, and what it will cost, either for you, or others. That ending cinematic on the good choice chokes me up every time. Those are probably the best examples I can think of(at the moment at least), where I felt most invested in being the protagonist, based on gameplay and setting.