1. Scrape squash into a large mixing bowl and allow to cool.
2. Meanwhile, in a heavy-bottomed saucepan, dissolve sugar in oil and bring to a low simmer, stirring often. Once it turns a dark amber color, remove from heat. Carefully pour hot sugar-oil mixture into squash and mix well until combined. Remove about 1/3 cup of accumulated liquid.
3. Add remaining ingredients and season to taste with salt and pepper and additional sugar, if desired.
4. Grease a 9-inch (20-cm) round baking pan or a large loaf pan, and pour kugel mixture inside. Bake for 45 minutes.
5. Remove from heat and allow to cool for 15 minutes before serving.
6. Do not freeze.