A French study from 2011 included patients with conditions similar to sleepwalking. Researchers taught them some choreography, then recorded them as they slept. It turns out the participants continued practicing the dance steps as they slept.
Researchers concluded that our brains continue working as we sleep, continuously going over the new things we learned during the day. As we sleep, our brains start going through all the things that happened to us that day, picking up on the most important. Then, our brains connect these important events to past experiences. The research suggests that when we dream about these events or skills, we have learned the new information effectively.
Other research has shown how getting enough sleep can improve your memory.