The deal allows Consolidated Edison, the electricity provider in New York City, to “sharply focus on our core utility businesses” and the state’s energy transition, company officials said.