Learning Domain Invariant Representationsin Goal-conditioned Block MDPs