I am currently on lollipop and I want to upgrade to marshmallow. Do I download the firmware for marshmallow and flash it using the FlashFire app? Or can I install it through TWRP? I want to upgrade my phone without losing my root
To my knowledge, this isn't possible. Root access is linked to what version of Android you are on. You should be able to unroot, flash the new ROM, reflash the custom recovery and reflash the updated version of Superuser.
You will need to flash the complete factory image... they are available on XDA... So is the rooting method, it is not just as simple as flashing SuperSU as in Marshmallow you need to use the manual systemless method, but it isn't difficult. Again, XDA has the tutorials you need to handle this, it is somewhat outside of the scope of what is usually talked about here.