Place sweet potatoes into a large pot and cover with salted water; bring to a boil. Reduce heat to medium-low and simmer until tender, 20 to 30 minutes. Drain and peel.
Preheat oven to 325 degrees F (165 degrees C).
Mash sweet potatoes, 1/3 cup butter, and white sugar together in a bowl. Beat milk, eggs, and vanilla extract into sweet potato mixture using an electric mixer until smooth; pour 1/2 the mixture into a 9x13-inch casserole dish.
Mix brown sugar, coconut, pecans, and flour together in a bowl; stir in 3 tablespoons butter until evenly coated. Sprinkle 1/2 the topping over sweet potato mixture. Pour remaining sweet potato mixture over topping and sprinkle with remaining topping.
Bake in the preheated oven until cooked through and topping is lightly browned, about 1 hour.