South Africa could be one of the world’s greatest success stories in energy transition if it can shed its apartheid-era legacy of coal dependency.