LittleFS, SPIFFS and FAT32 all have unique filesystem structures. Theoretically, you can read out the first block for the storage partition (if there is one at all) and try to do detection on that. For example, littlefs’s superblock contains the magic string "littlefs".
An easer way would be just try to mount each filesystem, with the setting to not format the filesystem if it could not be mounted (format_if_mount_failed = false). That way you can try mounting the next type of filesystem. For example
Just try these in sequence, and if one could be mounted, you found the right filesystem.
Of course, this is all a bit strange. After all, as the firmware developer, you usually just decide what filesystem the firmware will use. And if you never format your storage partition with a certain file system, then you won’t be able to use it anyway. So I absolutely don’t understand why you would need to “find out” what filesystem exist in the flash of the ESP32. You will decide what’s there.