Stable Learning via Self-supervised Invariant Risk Minimization