In a 5- to 6-quart pan, combine onion, garlic, and oil. Stir often over medium-high heat until onion is soft, about 5 minutes. While onion cooks, mince basil leaves. Add to onion along with tomatoes and their juice, wine, and chili flakes. Boil until reduced to 3 cups, about 10 minutes, stirring often and breaking tomatoes into small pieces. Use hot.