Causally-Inspired Regularization Enables Domain General Representations