Spectral Learning of Dynamic Systems from Nonequilibrium Data