It's good to consider the textual defintions of
hiri , moral shame.
I quote from Nina Van Gorkom's book
Cetasikas :
Moral shame, as the Attasaalini (a commentary) explains, can arise because of consideration of one's birth, one age, heroism (courage and strength) and wide experience. Moral shame arises from consideration of one's birth when someone of a respectable family does not want to act as someone who has not had a proper education. Moral shame arises from consideration of one's age when someone who is an adult does not want to behave like a child. Moral shame arises from consideration of heroism when someone does not want to act like a weakling but feels that he should have courage and strength. Moral shame arises from consideration of wide experience when one does not want to act like a fool who has not learnt anything.
I think we can find similar things in the suttanta, I often think of the passage in SN that says something like "this is a path for inferior people, not superior people, this is not for me."
The point is that if we want to think that having an understanding of anatta means not having an interest in our self-image we are going for the heartwood too fast, too hungry for the deepest, most penetrative wisdom. We can appreciation that mental factors such as hiri and otappa arise in an uncontrollable way even as we take wholesome pride in our self-image. That's the way I see it. Otherwise there is in my opinion a danger that people are so into appreciating anatta they develop a "well, that was a bad thing to do but understanding it as anatta is ultimately more valuable than having the wrong view that one can stop oneself from doing bad things" etc. That could creep into one's thinking as a justification for bad behaviour, I speak from experience here.