Heat the oil in a large saucepan and fry the onions over a low heat for 10 minutes until softened but not browned. Stir in 3 tbsp sugar, increase the heat and cook for 3-4 minutes until the onions are browned and caramelized. Add the garlic and cook for 1 minute.
Add the remaining sugar with the vinegars, mustard and salt. Simmer gently for 10-15 minutes until the liquid has reduced and the mixture is dark and thickened.
Spoon evenly between three 500ml clean sterilized jars and seal. Store for 6-12 months in a cool dark place. Once opened, store in the fridge and use within a couple of weeks.