Fundamental Limits and Tradeoffs in Invariant Representation Learning