Formation of hollow structures through diffusive phase transition across a membrane