Start by boiling the sweet potatoes in a large pot of salted water until fork-tender, which should take about 15-20 minutes. Drain the sweet potatoes and return them to the pot.
While the sweet potatoes are still warm, mash them using a potato masher until smooth. Then add melted butter, whole milk, brown sugar, eggs, vanilla extract, cinnamon, nutmeg, and salt. Mix until everything is well combined and creamy.
In a separate bowl, combine chopped pecans, brown sugar, flour, melted butter, and cinnamon. Mix until the pecans are coated with the sugary mixture.
Preheat your oven to 350°F (175°C). Pour the sweet potato mixture into a greased 9x13-inch baking dish. Sprinkle the pecan topping evenly over the top. Bake for about 35-40 minutes or until the topping is golden brown and the filling is bubbling.
Notes
Overcooking the sweet potatoes can lead to a watery consistency in your casserole. Remember to grease the baking dish to prevent sticking.