Place the potatoes into a large pot and cover with salted water. Bring to a boil over high heat, then reduce heat to medium-low, cover and simmer until tender, about 20 minutes. Drain and allow to steam dry for a minute or two. Heat 1/4 cup of vegetable oil in a frypan over medium heat. Stir in the onion; cook and stir until the onion has softened and turned translucent, about 5 minutes. Combine potatoes and onions in a large bowl; season with 2 teaspoons of salt, pepper, sugar and garlic. Mash until smooth; set aside.
Preheat an oven to 190 degrees C. Line a baking tray with baking paper.
Beat eggs, 1/2 cup of vegetable oil, warm water and 1 teaspoon of salt. Gradually stir in flour. When the dough has pulled together, turn it out onto a lightly floured surface and knead until smooth and elastic, about 8 minutes. Divide the dough into thirds and roll each piece out to about 20x30cm. Slice the rolled dough in half lengthwise, then spread the potato mixture down the centre of each strip. Roll each strip around the filling and gently press to seal. Repeat with the remaining dough and filling to end with six logs.
Cut each log into 3cm slices and place cut side down on the prepared baking tray. Gently press the edges of the dough toward the centre of the potato mixture to form a bun. Beat egg yolks and milk together in a small bowl. Brush each knish with the the egg yolk mixture.
Bake in the preheated oven until golden brown, 35 to 45 minutes.