Radial profiles of the rotational transform are measured with the motional Stark effect spectroscopy in the Large Helical Device. They are derived from the radial profiles of the polarization angle of the and components in the H line emitted from high-energy hydrogen atoms of beams with four sets of linear polarizers, spectrometers, and charge-coupled device detectors. Changes in the rotational transform due to the neutral beam current drive (NBCD) and the electron cyclotron current drive are measured. When NBCD is in the direction counter to the equivalent plasma current, the central rotational transform increases because of the inductive current while the edge rotational transform decreases, as is expected. Therefore, the magnetic shear becomes weak with NBCD in the counterdirection, whereas it becomes strong with NBCD in the codirection. NBCD that drives toroidal current, typically <10% of the equivalent toroidal current determined by the external current in the helical coils, can change the rotational transform and magnetic shear significantly enough to change magnetohydrodynamic stability.