It is stored in the metadata [1], but anything larger than 8 MiB is not guaranteed to be supported. So there has to be an out-of-band agreement between compressor and decompressor.
[1] https://datatracker.ietf.org/doc/html/rfc8878#name-window-de...
[1] https://datatracker.ietf.org/doc/html/rfc8878#name-window-de...