Neuromechanical Mechanisms of Gait Adaptation in $\textit{C. Elegans}$: Relative Roles of Neural and Mechanical Coupling