How can you stop a child's mother's boyfriend from spanking a child?

Spanking is legal and apparently the way this mother chose to discipline her son since she has given her boyfriend to do so. The only way to stop it is to speak to the mother but she might tell you off since people rarely like when people interfere in their child raising.