In 1.21.1 and earlier versions which support this debug feature, pressing F3 and S would create lightmap textures in the screenshots/debug directory. As of 24w33a, this no longer seems to happen.