Origins of ferromagnetism in transition-metal doped Si