Topological analysis of spin-torque driven magnetic skyrmion formation