Photograph: Dan Jones
Gently soften the onion in a frying pan with a splash of olive oil, then tip into a bowl and allow to cool slightly. Add the mince, oregano, parmesan, egg yolks and chilli flakes, if using. Season and mix together gently with your hands.
Divide the mixture into 24 and roll into little balls (this is easiest if you wet your hands first).
Heat a little more oil in the pan and brown the meatballs all over. Remove from the pan and set aside. Drain off some of the oil from the pan, add the garlic and fry until just golden.
Tip the tomatoes into the pan with the balsamic vinegar and sugar. Bring to the boil, then simmer for 5 minutes; season. Add the browned meatballs, turn down the heat and cook, covered, for 20 minutes, removing the lid for the final 5 minutes. Serve in bowls with pasta, and scatter over the basil and parmesan shavings.
Get ahead: you can make the meatballs a day ahead; cover and chill.
Kitchen secret: ring the changes - try pork mince and dried sage, or lamb mince and finely chopped rosemary. You could also try adding fried diced pancetta to the mince mixture and extra chilli to the sauce.