Grate the cold butter and freeze at least 10 minutes.
Combine flour, salt, and sugar. Whisk in butter until flour mixture well coats butter pieces.
Add cold water a little at a time, combining well, until a dough forms. Shape dough into patty (like a large hamburger), wrap in plastic, and refrigerate 45 minutes.
Pour 3 Tablespoons olive oil in a medium skillet. Heat oil over low heat and then add onions. Toss well to coat.
Cook onions over low heat 30-45 minutes, stirring frequently. If onions start to dry out, add water.
Remove onions from heat when caramelized.
Preheat oven to 375.
Remove dough from refrigerator. On a floured parchment paper, roll dough out until consistently ⅛th-inch thick. Transfer parchment paper and dough to baking sheet.
Leaving a 3-inch space around the edge, top dough with crumbled goat cheese, basil, black pepper, and onions.
Top with sliced tomatoes. Drizzle tomatoes with olive oil and salt & pepper.
Gently fold edges over the sides of the tomatoes.
Brush exposed crust with egg.
Bake 1 hour, or until tomatoes begin to char and crust turns golden brown.