Personal experience and a bit of research, not a professional:
Weaning is done pretty much the same with all animals, including humans. You deny them access to an accustomed source of food. With rodents, you put them in a different cage. Alternatively, the mother will eventually start refusing to nurse them, which has the same result - but by the time she does that they may be old enough to be interbreeding. With calves, you either remove them from the mother, or attach a flap to their nose that prevents them from nursing. With horses, you remove them from the mother. Otherwise, you may end up with two-year-old horses still nursing, depending on the dam. With dogs and cats, usually the mother gets tired of nursing them and starts refusing. By five weeks old, mice and rats are pretty much just nursing for comfort. They're fully capable of living on solid food.
Weaning is a gradual process, in that by five weeks old, or four weeks really, the rodents have already been eating solid food for a while if it's available for them to eat.