Crystallographic alignment between two-dimensional crystals in van der Waals heterostructures brought a number of profound physical phenomena, including observation of Hofstadter butterfly and topological currents, and promising novel applications, such as resonant tunnelling transistors. Here, by probing the electronic density of states in graphene using graphene-hexagonal boron nitride tunnelling transistors, we demonstrate a structural transition of bilayer graphene from incommensurate twisted stacking state into a commensurate AB stacking due to a macroscopic graphene self-rotation. This structural transition is accompanied by a topological transition in the reciprocal space and by pseudospin texturing. The stacking transition is driven by van der Waals interaction energy of the two graphene layers and is thermally activated by unpinning the microscopic chemical adsorbents which are then removed by the self-cleaning of graphene.