Optimal spatiotemporal reduced order modeling, Part I: proposed framework