Cook onions in a large pot of boiling water until tender but not falling apart, 25 to 30 minutes. While onions are cooking, remove leaves from lower 3 inches of each rosemary sprig and chop enough leaves to measure 1/2 teaspoon. Cut sprig ends at an angle to form a point so they can act as skewers. Remove onions from pot with a slotted spoon and, when cool enough to handle, cut off top inch of each with a sharp knife and finely chop tops. Trim root end of each onion slightly, if necessary for onions to stand up without rolling. Scoop out about a heaping tablespoon from center of each onion (keeping outside intact) and finely chop, adding to rest of chopped onion. Transfer hollowed onions to an oiled 8-inch square baking dish. Preheat oven to 400°F. Cook chopped onion, garlic, and chopped rosemary in oil in a large heavy skillet over moderate heat, stirring, until onion is softened, about 3 minutes. Stir in cream and remove from heat. Stir in parmesan, sea salt, and pepper to taste. Fill whole onions with some of chopped onion mixture and spoon remainder around whole onions. Wrap a slice of pancetta around middle of each onion and secure with a rosemary sprig or wooden toothpick. Bake onions, uncovered, in middle of oven, until very tender, 40 to 50 minutes depending on size of onions.