At Address, both ankles and knees are in a neutral position without any internal or external rotation present. Notice how the crease of the pants falls straight down the pants leg.
As the backswing progresses, the right ankle and knee both externally rotate. The right knee points to the right and the two bony structures of the right ankle twist horizontally to the right. This movement pulls the crease of the pant all the way over to the right portion of the right leg.
The identical movement occurs to the left ankle and knee during the finish. The left knee is now rotating externally left and the two bony structures of the left ankle twist horizontally to the left. It is also common for the left heel and ankle to have re-planted inside where they started providing an even greater range of turning motion for the left ankle.