Prep the pork. Preheat the oven to 325°F (163ºC). Pat the pork (4 - 5 pounds) dry and trim away any very thick exterior fat. If using boneless pork shoulder, cut it into 3–4 large pieces. If using bone-in pork shoulder, cut the meat into several large pieces where possible, leaving the portion surrounding the bone intact. Season all over with the salt (1 1/2 teaspoons) and pepper (1 teaspoon).
Sear the pork. Heat the oil (2 tablespoons) in a 5 1/2–7-quart Dutch oven over medium-high heat. Working in batches if necessary, sear the pork for 3–4 minutes per side, until deeply browned. Transfer to a plate.
Cook the onions and garlic. Reduce the heat to medium. Add the red onions (2) and cook for 4–5 minutes, stirring occasionally, until the edges begin to brown. Add the garlic (5 cloves) and cook for 30 seconds.
Add the flour and Dijon. Sprinkle the flour (2 tablespoons) over the onions and cook for 1 minute, stirring constantly. Stir in the Dijon mustard (2 tablespoons).
Build the braising liquid. Slowly pour in the apple cider (2 cups) while scraping up the browned bits from the bottom of the pot. Add the chicken broth (1 cup), 2 tablespoons apple cider vinegar, Worcestershire sauce (1 tablespoon), thyme (5 sprigs), sage (5–6 leaves), rosemary (2 sprigs), bay leaves (2), and red pepper flakes (1/2 teaspoon), if using.
Return the pork to the pot. Bring the liquid to a gentle simmer. Return the pork and any accumulated juices to the Dutch oven. The braising liquid should come approximately halfway up the sides of the pork.
Braise the pork. Cover the Dutch oven and transfer it to the preheated oven. Braise for 2–2 1/2 hours, until the pork is beginning to become tender.
Add the apples. Tuck the apple wedges around the pork and onions. Cover and return to the oven for 45 minutes, until the pork is fork-tender and pulls apart easily and the apples are tender but still hold their shape.
Reduce the sauce. Transfer the pork and apples to a platter. Discard the bay leaves and herb stems. Place the Dutch oven over medium heat and simmer the sauce uncovered for 5–10 minutes, until reduced and glossy.
Balance the sauce. Stir 1 teaspoon apple cider vinegar into the reduced sauce. Taste and season with additional table salt, black pepper, and cider vinegar as needed.
Finish the sauce. Remove the Dutch oven from the heat. If using, stir in the butter (1 tablespoon) until melted and the sauce is smooth and glossy.
Serve. Return the pork and apples to the sauce, or arrange them on a serving platter and spoon the cider-Dijon sauce and onions over the top. Garnish with fresh thyme or chopped parsley.