Dany doesn't go mad in the TV show, nor in the books. She's not "going mad", she's being further and further ensnared into her own childhood trauma.
She's desperate for a protector as a child, she seeks one in many places. But when she "immolates" her childhood self and creates the dragons - both children for her to protect and tools to protect herself - she attempts to put that behind her by becoming a protector of others rather than wanting protection.
This is why she says "If I look back, I am lost". She doesn't wish to be that child any longer.
Each time she "protects" people, by freeing them from slavery, from oppression, from danger, etc., she relives this very intense personal need. Maybe one needs to have a similar need in oneself to understand. When you act out based on personal trauma, you are always, to some extent, reliving or re-accessing that trauma.
The act of actually ruling people, leading people, and so on, does not fulfil this need in the same primal way defending them with the dragons does. So the more and more she uses the dragons, the more and more she feeds her own deepest, unresolved fears and desires.
Think of people addicted to sex with the strangers, or who keep entering relationships with the same kind of people who hurt them, and so on.
Dany is trying to cure her own deepest needs, and it overwhelms her past her ability to see what it is doing to others.