Transport for London’s legal chief quits after Tube transfer