A reinforcement learning algorithm shapes maternal care in mice