We explore the regularity theory of optimal transport maps for costs satisfying a Ma–Trudinger–Wang condition, by viewing the graphs of the transport maps as maximal Lagrangian surfaces with respect to an appropriate pseudo-Riemannian metric on the product space. We recover the local regularity theory in two-dimensional manifolds.