Fix in serialize and deserialize collections.
Serialize and deserialize collection using the respective registered type for each component of collection dict.
Earlier we did not use the STATE_REGISTRY to serialize/deserialize each component of collection; for a collection containing dataclass it would throw error: `can't serialize <dataclass name>`.
PiperOrigin-RevId: 325868958