Heat a dash of oil in a large frying pan, and add the onion and garlic. Cook over a medium heat for 5 minutes, stirring regularly, until soft and translucent. Add the spices, vinegar, and tomato ketchup, and mix well to combine. Add the chunks of jackfruit, and cover the pan with a lid. Bring to a gentle simmer, and leave to cook for around 20 minutes, stirring occasionally. You can add a dash of water if needed.
While the jackfruit is cooking, prepare the onions. Add the sliced red onion to a small pan with the vinegar, water, salt and sugar. Bring to a boil (the onion will quickly cook down into the small amount of liquid), cook for 30 seconds or so, then remove from the heat. Set aside to cool. The pickled onions can be made in advance and stored in the fridge for a few days if needed.
When the jackfruit is tender, use two forks to 'pull' it into meat-like strands. Add the soy sauce and Marmite, and mix well.
To assemble, spread some burger buns with mayonnaise, and add a heap of the pulled jackfruit. Top with pickled onions and slices of cucumber.