Make the pork: Season the pork generously with salt and black pepper and set aside. To a large pan set over medium heat, add the oil. When it’s hot and shimmering, add the onions cut-side down and cook until deep golden brown, about 6 minutes. Transfer to a large plate.
Pat the pork dry with paper towels. Turn the heat to medium-high and add more oil if the pan looks dry. When it’s hot and shimmering, add the pork and cook, flipping halfway through cooking, until browned on both sides, about 7 minutes total. Transfer to the plate with the onions.
To the empty pan, add the sherry and continue cooking over medium-high heat, scraping up any browned bits, until reduced by about half, 2–3 minutes. Return the pork and onions to the pan, then add the stock and bring to a boil. Turn the heat to low and add the rosemary and bay leaf. Cover and cook until the pork is softened and nearly falling off the bone, about 1 hour 30 minutes. Season with salt, then add the beans. Turn the heat to medium and simmer, uncovered, for 30 minutes more.
Meanwhile, make the almond gremolata: To a small dry pan set over medium heat, add the almonds and cook, swirling the pan occasionally, until golden, about 10 minutes. Add the oil and garlic and cook until the garlic is fragrant and just beginning to brown, about 1 minute. Stir in the lemon zest, then scrape into a small bowl and stir in the parsley.
To serve, transfer the pork to a serving platter if desired (or serve straight from the pot) and sprinkle with the gremolata.
