GM and other automakers have been navigating an uncertain transition to electric vehicles both in the U.S. and worldwide.