Preheat the oven to 375°F and lightly grease a 9x13-inch baking dish.
In a large pot, cover the sweet potatoes with water and bring to a boil. Cook for 15–20 minutes, or until tender when pierced with a fork. Drain well and let cool slightly.
Mash the sweet potatoes in a large bowl until smooth. Add the softened butter, granulated sugar, milk, eggs, vanilla, cinnamon, nutmeg, and salt. Mix until fully combined and creamy. Spread the mixture evenly into the prepared baking dish.
In a separate bowl, combine the brown sugar, flour, cold cubed butter, and pecans. Use a fork or your fingers to mix until crumbly and well incorporated.
Sprinkle the pecan topping evenly over the sweet potato mixture.
Bake in the preheated oven for 25–30 minutes, or until the topping is golden brown and the casserole is bubbling around the edges.
Remove from the oven and let cool for 10 minutes before serving.