ToMoE: Converting Dense Large Language Models to Mixture-of-Experts through Dynamic Structural Pruning