Heat the oil in a large skillet over medium heat. Add the garlic and fry until fragrant, about 30 seconds. Remove the garlic from the oil, reduce the heat to low, and add the mushrooms, thyme, rosemary, salt and pepper. Cover and cook, stirring occasionally, until the mushrooms are soft, 7–9 minutes.