Tesla Inc.’s shares surged after the carmaker reported surprisingly strong earnings and forecast as much as 30% growth in vehicle sales next year.