Meanwhile, slice the onions into ¼-inch rings and separate the pieces. Heat the oil in a large skillet over medium-high heat. Working in batches, add the onion rings to the skillet and sauté until golden, flipping once with tongs, about 2 minutes per side. Transfer the onion rings to a large bowl. Add the garlic to the skillet and cook until golden, about 1 minute. Transfer to the bowl with the onions. Let the oil cool slightly, then drizzle it over the onion mixture, season with salt and pepper, and set aside.