Hilchos Lashon Hara chapter 9, section 5
Even if a person hears their own young children speaking lashon hara (harmful speech about others), it is a mitzvah to correct them and stop them. As it says: "Educate the child according to his way" (Mishlei 22:6).
As the Orach Chaim (343:1) explains, this applies to all the prohibitions of the Torah.