Generalizing across Temporal Domains with Koopman Operators