Everything is ruled by quantum mechanics in the microscopic framework. Atoms, molecules, lattices all follow the rules of quantum mechanics, including vibrations and rotations.This means there are potentials, which are electric or magnetic, i.e. the electromagnetic force is acting at this level, and there are in principle solutions of quantum mechanical equations which the atoms, molecules, lattices have to obey.
It is a many body problem, how to go from the quantum frame to the classical frame where thermodynamic quantities like heat are defined, and there are various quantum mechanical models used depending on the specific problem . An example of such models is the band theory of solids, which is used for the behavior of matter under electricity.
For heat one does not need specific calculations as the classical theories of thermodynamics and classical statistical mechanics model well the underlying quantum behavior. When necessary , quantum statistical mechanics can be used.
We talk of vibrations and rotations but these are vibrational and rotational levels, quantum mechanical states, where the energy exchanges happen through exchanges of photons at energy levels of infrared frequency, which finally end up in giving the black body radiation of any matter, which we sense as heat.
So at the microscopic level all energy transfers happen through quantized electromagnetic interactions, from which the classical theories emerge.