1. Prepare macaroni according to package directions; drain and set aside.
2. Melt 2 Tbsp. butter in a large skillet over medium-high heat. Add sliced onions and 1 tsp. sugar. Cook, stirring often, 15 to 20 minutes or until onions are caramel-colored.
3. Layer half each of macaroni, onions, cheeses, and cracker crumbs in a lightly greased 13- x 9-inch baking dish. Layer with remaining macaroni, onions, and cheeses.
4. Whisk together eggs and next 3 ingredients; pour over macaroni mixture.
5. Stir together remaining cracker crumbs, melted butter, and, if desired, pecans. Sprinkle evenly over macaroni mixture.
6. Bake at 350° for 1 hour or until golden brown and set. Let stand 10 minutes before serving.