In a mixing bowl, combine warm water, sugar, and yeast. Let it sit for about 5 minutes until foamy.
Stir in olive oil and salt. Gradually add the flour, mixing until a dough begins to form. Knead by hand or with a stand mixer for about 5-7 minutes until the dough is smooth and elastic.
Form the dough into a ball and place it in a greased bowl. Cover with a kitchen towel and let it rise in a warm place for about 1 hour, or until doubled in size.
Preheat your oven to 425°F (220°C) and line a baking sheet with parchment paper.
Once the dough has risen, punch it down and divide it into 8 equal pieces. Roll each piece into a rope about 18 inches long.
Place a tablespoon of shredded mozzarella at the center of each rope. Fold the sides of the dough over the cheese and roll it back into a pretzel shape, making sure the cheese is sealed inside.
In a large pot, bring 10 cups of water to a boil. Add the baking soda carefully.
Boil each pretzel for about 30 seconds, then use a slotted spoon to transfer them to the prepared baking sheet.
In a small bowl, beat the egg and brush it over the top of each pretzel. Sprinkle with coarse salt and the grated Parmesan cheese, and add chopped rosemary on top.
Bake in the preheated oven for 12-15 minutes or until golden brown.