The Energy Department said it will fund $12 billion in loans and grants to support the auto industry's transition to electric vehicles.