Pressing the shortcut for the mode again will unlock the selected axis. E,g, if you are in translation and have the X axis active by pressing W it will go back to moving in screen space.
For rotate pressing E will reset the axis. Then pressing E will swap between screen rotation or “free form” rotation.