For the marinated pork, mix together the garlic, yellow bean sauce and Shaoxing rice wine in a bowl. Add the pork and stir well to coat.
For the sweet and sour sauce marinade, mix together all of the sauce ingredients in a bowl and add to the pork. Mix well to combine, then cover with cling film and leave to marinate in the fridge for at least 24 hours.
To cook the pork, heat a wok until smoking and add the groundnut oil. Add the sliced pork (reserving the marinade) and stir-fry for 3-4 minutes, or until browned. Add the reserved marinade and bring to the boil. Reduce the heat to simmer for 3-4 minutes, or until the sauce is thick and sticky.
For the caramelised onions, heat the groundnut oil in a small wok or pan, add the red onions and stir-fry for 4-5 minutes, or until softened but not coloured. Add the black rice vinegar and the brown sugar, stirring well, and leave to cook for 2-3 minutes, or until caramelised.
To serve, fill the buns with some salad leaves. Top with slices of the sticky pork, some caramelised onions and sliced tomatoes, if using. Serve immediately.