Normally you'd compile it manually and add it as a separate emulator, but the current version doesn't compile on current RetroPie (Pi3/Pi4). You may wait until the new version of RetroPie (based on the Raspi OS bullseye) is released and the standalone flycast will be installable.
I've started working on a RetroPie module to integrate it, but due to some rendering bugs and the aforementioned incompatibility, I didn't add it to RetroPie proper yet.