Discovery and Separation of Features for Invariant Representation Learning