Place all of the ingredients except the ribs in a medium bowl and stir to combine. Place the ribs in a 13-by-9-inch baking dish and arrange them in an even layer. Evenly rub the spice mixture on all sides of the ribs and cover the dish with aluminum foil. (At this point, you can roast the ribs immediately, but for the best flavor and texture, refrigerate them for up to 24 hours.)
Heat the oven to 350°F and arrange a rack in the middle. (If you rubbed the ribs in advance, remove them from the refrigerator and set aside at room temperature while the oven is heating, at least 20 minutes.)
Place the ribs in the oven and roast until fork-tender, about 2 hours. Meanwhile, make the sauce.
Heat the oil in a medium saucepan over medium heat until shimmering. Add the onion and garlic and cook, stirring occasionally, until softened, about 3 minutes.
Add the remaining ingredients, whisk to combine, and bring to a simmer. Reduce the heat to low and continue to simmer, whisking occasionally, until the flavors have melded and the sauce has reduced to about 2 1/2 cups, about 30 to 40 minutes. Remove from the heat and set aside until ready to grill the ribs.
Heat a gas or charcoal grill to medium (about 350°F to 450°F).
Place the ribs on the grill and brush them with some of the sauce. Cover the grill and cook until grill marks appear on the bottom of the ribs, about 5 minutes. Turn the ribs, brush with sauce, cover, and cook another 5 minutes. Flip and brush every 5 minutes until the sauce has thickened and formed a glaze and the ribs are heated through, about 20 minutes total. Transfer the remaining sauce to a serving bowl and serve with the ribs.