Preheat oven to 400°.
Cook the bacon in a large skillet over medium heat, turning occasionally, until cooked but still soft, about 6 minutes; remove to paper towels. Once cool, roughly chop and reserve.
Add the sliced onions to the bacon grease, stirring to coat, and lower the heat to low. Cook, stirring occasionally, until onions are soft and golden brown, 30 to 35 minutes. At the end, add a few tablespoons of water if the onions are too dry. Season with pepper and salt to taste. Reserve.
Roll out dough on a lightly floured sheet of parchment paper to about 14” round and ⅛” thick. Transfer on the parchment paper to a large baking sheet.
Add a layer of potato slices, seasoning with salt and pepper. Keep layering, alternating with caramelized onions and chopped bacon. Remember to season, always!
Finish off with the crumbled goat cheese and rosemary leaves. Drizzle with a little olive oil and season with salt and pepper.
Bring edges of dough up and over filling, overlapping as needed, to create a 1½” border; brush with the beaten egg. Add the chilled butter cubes to the top of the galette.
Bake the potato galette, rotating once, until crust is golden brown and cooked through, 35–40 minutes.
Let it cool slightly and sprinkle the grated pecorino and drizzle with the white truffle oil, if using.