Tesla has earned at least $6 billion in sales of regulatory carbon credits to other automotive makers.