Stock rom installation using twrp?
Before you do the upgrade, via TWRP, select backup> the select system, data (if you want yours apps), boot, and recovery. This will backup what is currently installed on your phone. Once this completes, go ahead and install the MM update for your phone. Do this within twrp as well to keep the custom recovery.