DOUGH: Whisk together flour, sugar, and salt in a large chilled bowl. Add cubed butter and toss to coat. Use your fingers or a fork to cut butter into flour. Once butter pieces are size of walnut halves, add grated cheese and mix with a rubber spatula to combine. If you find butter warming up at any point, refrigerate bowl for a few minutes.
Mix water with vinegar and drizzle a few tablespoons over flour-butter mixture. Using a rubber spatula, stir water into flour. Continue to add more water, a few tablespoons at a time, until dough is hydrated but not sticky—when you squeeze dough into clumps, it shouldn’t fall apart. Press dough together, divide in half, and form into 2 squares. Wrap in plastic wrap and chill in refrigerator for at least 1 hour, or overnight.
FILLING: Toss all ingredients in a medium bowl until combined. Taste and season with more sugar, lemon juice, spices, or salt if needed.
TO ASSEMBLE: Roll out 1 dough square on a lightly floured surface into a ¼-inch-thick square (a little larger than 12 inches). Trim edges to straighten, then cut dough into 12 rectangles. Transfer 6 rectangles to a parchment-lined baking sheet and spoon 1½ to 2 tablespoons of filling in center of each. Lightly brush dough edges with water. Top with remaining 6 rectangles. Press edges gently to seal, then crimp with a fork. Transfer pies to refrigerator and repeat process with second dough square. Chill pies for at least 30 minutes or freeze for 20 minutes.
Heat oven to 400°F. Lightly beat egg with milk in a small bowl. Cut 2 small slits in top of each pie to vent. Brush with egg wash, then sprinkle with coarse sugar or flaky sea salt. Bake for 20 to 25 minutes, until crust is golden brown. Cool for a few minutes before serving.