In a large skillet, heat the olive oil over medium-high heat. Add the onion and garlic and season with salt and red pepper flakes. Cook until the onions become translucent, 3 to 5 minutes. Add the sugar and the canned tomatoes. Use a wooden spoon to break up some of the whole tomatoes and cook 10 to 15 minutes over medium heat, stirring from time to time. Taste for seasoning, the tomatoes should be fairly broken down and the flavors coming together. Cook for another few minutes if the tomatoes still taste like they need a little more time to break down. Set aside to cool.