As a dog trainer, I have witnessed some weird behaviors. But never this one.
Is he breakdancing? Imitating a Roomba? Perhaps it's a self-calming behavior or stereotypy? Or an itch in a really weird place?
My best guess is that it's a reflexive outlet for excitement. A kind of displacement of energy, like pounding your fist in the air or jumping up and down. It's not surprising that this is something the dog is doing during training. In the scheme things, it's actually not such an inappropriate "excitement" behavior. I've heard of horses getting so happy during clicker training that they get erections. Sometimes, my dog humps the air when he gets amped up.
Out of respect for him, I will not post a video of that.
But I will reshare this video of him "dancing" in his boots, just because it's hilarious.