In a medium skillet over medium heat, add the butter. When the butter begins to foam, add the red onion and season with salt, and cook, stirring often, until the onions soften, 4 to 5 minutes. Deglaze the pan with the white wine vinegar, add the sugar and continue cooking until the vinegar is almost completely evaporated, another 2 minutes.
In a separate pan over high heat, add the olive oil. When the oil is hot, add the cabbage and let it sit for 30 to 40 seconds until the leaves begin to slightly char. Stir and continue to cook until the cabbage begins to wilt and is just tender, 6 to 8 minutes. Add the caraway, crushed red pepper flakes and stout, and cook until the beer is almost completely evaporated, 2 to 3 minutes. Season with salt and pepper. Add the red onions and lemon juice to the cabbage and toss. Serve with corned beef.