The legislation would require U.S. regulators to mandate installation of driver-monitoring systems to ensure motorists pay attention while using systems like Tesla’s Autopilot.