The MUSE Hubble Ultra Deep Field Survey: V. Spatially resolved stellar kinematics of galaxies at redshift $0.2\lesssim z \lesssim 0.8$