Learning coherences from nonequilibrium fluctuations in a quantum heat engine