A generalized tool for accurate time-domain separation of excited modes in spin-torque oscillators