It depends on what you are actually looking for, but, from the firmware point of view, there are two different classes of "flight modes": commander and the navigator states. You can find them into
PX4 modules are standalone tasks/works, so you can somewhat analyze them one by one. For instance, commander handles RC commands, calibration and arm routines, etc, while navigator handles mission items, mission modes and generate position references, which are later interpreted by the MPC (multicopter position control) module (if you are using a MC airframe) and so on.
If you are trying to implement a new take off strategy, you can both change how references and logic is set or how the position controller handles this information. For now, it is hard to say which one is the best solution.