Heat the oven to 350°F (175°C) with a rack in the center.
Place the sliced yellow squash in a colander set over the sink; sprinkle with 1 teaspoon kosher salt, toss, and let drain 10–15 minutes, then gently squeeze to remove excess moisture.
Melt 2 tablespoons unsalted butter in a large skillet over medium heat; add the finely chopped onion and cook until translucent, 3–4 minutes. Add the drained squash and cook, stirring occasionally, until tender and most liquid evaporates, 8–10 minutes. Spread the mixture on a sheet pan to cool 5 minutes.
In a large bowl, whisk the beaten eggs; add the sour cream, mayonnaise, all-purpose flour, black pepper, and shredded sharp cheddar cheese, and stir until smooth.
Fold the cooled squash mixture into the bowl until evenly coated; transfer to a 2-quart baking dish and smooth the top.
In a small bowl, combine the crushed butter crackers with 2 tablespoons melted unsalted butter until evenly moistened; sprinkle over the casserole.
Bake until the topping is golden and the center is set, 25–30 minutes; let stand 10 minutes before serving.