Exporting Animations From the Same Project

If I were to create first person animations with only arms and a gun, how would I export the arm and gun animations separately if i’m using them in the same project/scene?
I’m using Maya 2019 btw. Also I know that having gun anims and arm anims is not the most efficient way of doing it and that it’s not “true” fps.

It depends based on the character, but usually the gun has its own joint that is part of the character skeletal hierarchy, so in general if you export the character animation, you’re also exporting the gun animation as well.
What you can do in Maya is to unparent the gun joint, create two groups, one for the character skeletal joint + character, the other one with the gun joint+gun, and add a root joint to the gun bone, so that the two skeletons are animated, but using a different skeletal hierarchy.

I would suggest completely extruding any gun parts from the arm parts and running everything as completely separate so that you can later merge the two or a different weapon.

The proper way to adjust or fit animation to guns is setting up an hand IK.
the hands can respond to sockets placed on the gun in the editor and allow you to manipulate the in-game positions with almosy dead on accuracy regardless of what gun the initial animation was for.

Yes it does add some overhead. No, you probably do not want to do this if you are working on a mobile game.

Still you probably want to separate the arms from the gun entirely in such a way that if you transfer the game off of mobile you CAN do all of that with sockets and a modicum of “black magic”, also known as trigonometry.