Where do sperm get the energy to keep the flagellum moving?

Mitochondria. The mitochondria are the energy producing portions of the cell, and it is atp on a biochemical level.