attr(x = mod2$terms, which = "predvars")
## list(Sepal.Width, ns(Petal.Width, knots = 1.3, Boundary.knots = c(0.1, 
## 2.5), intercept = FALSE), Species)
## The part with `ns` is in the _third_ element:
attr(x = mod2$terms, which = "predvars")[[3]]
## ns(Petal.Width, knots = 1.3, Boundary.knots = c(0.1, 2.5), intercept = FALSE)