Derivation of the transverse force on a moving vortex in a superfluid