Laboratory simulation of cosmic string formation in the early Universe using superfluid 3He