Automakers are facing a wave of new legislation in state capitols to rein in the internet-connected technologies increasingly being embedded in vehicles amid growing concerns the industry isn’t doing enough to prevent privacy violations such as stalking.