I am trying to log the variable data to Flash module at every 15 sec interval. Once the log file gets stored, I want to end user to have the functionality of downloading this logged file and access it via USB port of RAK19007 base (2nd gen) used with RAK11200 (ESP32).
I think a good start is to look into the Adafruit_SPIFlash library, which supports both direct Flash access and the usage of a file system for reading/writing you log data.
To send them over USB, you will have to implement some kind of protocol that allows file transfer over a serial, for example YModem. And on your computer you need of course an app that can receive the log via YModem and safe it. I found an example that seems to be close to what you want to do 230_Arduino_to_PC_File_Transfer_YModem