On the gauge structure of classical mechanics