Heat oil in a medium frying pan over medium heat. Add the chiles, onion, and garlic and season with salt and pepper. Cook until softened and starting to brown, 8 to 10 minutes. Set aside.
Divide ground beef into 4 pieces and flatten into patties. Season generously with salt and pepper.
Heat a large cast iron skillet over medium heat. Add the burger patties and cook undisturbed until browned on one side, about 5 minutes. Flip and cook until browned on the other side, about another 5 minutes for medium.
Turn off the heat and top each burger with a heaping tablespoon of the chile mixture. Evenly divide the cotija cheese between the burgers and cover pan with a lid to melt the cheese.
While cheese is melting, toast the buns and combine all the mayonnaise ingredients together in a small bowl until smooth.
Spread a generous spoonful of mayonnaise on the bottom half of each bun. Place the burger over the mayonnaise and top with other side of the bun. Serve immediately.