I raised my horse since birth. He was weaned by still nursing and gradually eating grain and then eating hay while drinking less and less milk (mom does this). Eventually you seperate mom and baby (babies depending on species) to complete the weaning process and discontinue nursing. Or with rats mom will wean them and discontinue letting them nurse around 5/6 weeks. It is a gradual process. Rats start nibbling on solid foods around two weeks and are eating mostly solid foods at three weeks.

And rats learn social skills from their mom. Many report bigger healthier babies from leaving them in longer and also better tempered babies. We all do things differently though. I'm in quite a few rat FB groups and we all discuss our own techniques/setups/whatever.