Portion into individual pint-size jars to have fresh tomato sauce on hand all year long.
Heat oil in a large pot over medium heat. Add onions and garlic and cook, stirring occasionally, until onions are very soft and translucent, 10 to 15 minutes. Add tomato paste and cook 2 minutes more. Add tomato puree and basil. Bring to a boil, then reduce heat and simmer, stirring occasionally, until flavors meld and sauce has reduced to 8 cups, about 1 hour 15 minutes. Season to taste with salt, black pepper, and red-pepper flakes. Let cool to room temperature, about 1 hour.
Portion into jars, leaving 1/2 inch of headspace. Freeze until ready to use, up to 1 year.