Learning Domain Invariant Representations in Goal-conditioned Block MDPs