The glass transition of an amorphous material is a fundamental property characterized by an abrupt change in viscosity. Its very knowledge was a conundrum as no satisfying theory existed at the molecular level. We herein relate this complex phenomenon to events occurring at the molecular scale. By studying conformational transitions in the carbon-chain polymer of polyethylene, we clearly establish a relation between local dynamics and the classical dihedral potential energy diagram of a carbon-carbon bond. This methodology is applied to a carbon-chain polymer with a side-group, polystyrene. A direct link is proved between activation energy and glass transition temperature. This work thus provides the cornerstone for linking molecular structure to macroscopic polymer properties, and in particular, the glass transition temperature.