Preheat convection oven to 400°F or conventional oven to 425°F. Line a full sheet pan with parchment paper. Coat two 2-inch full hotel pans with cooking spray.
Cut ends off spaghetti squash. Stand on one flat end and then cut spaghetti squash in half lengthwise. Remove seeds by gently scooping them out along with the strings that surround the seeds. (Do not remove the fl esh of the squash.) Place each half cut side down on the prepared sheet pan. Bake until very tender when pierced with a fork and skin is beginning to brown slightly, about 45 minutes. Let cool then use a fork to scrape the squash out into strings. Divide between the prepared hotel pans (don’t mash it, you want it to remain stringy.)
Meanwhile trim, peel and finely dice onions.
Trim, peel and chop garlic.
Heat oil in a large saucepan. Add the onions and cook over low heat until tender but not browned, 10 to 15 minutes. Add the garlic and continue to cook for 5 minutes more.
Put tomatoes in a food processor fitted with a steel blade and pulse for about 30 seconds. (Alternatively, mash tomatoes in a large bowl with a potato masher.) Add the tomatoes to the pot with oregano, basil and salt. Bring to a steady simmer and cook until reduced to 2 qt, 20 to 30 minutes.
Reduce oven temperature to 350°F (convection) or 375°F (conventional).
Top each pan of squash with 1 qt sauce, spreading evenly over the top. Sprinkle each with 1 qt cheese. Bake until the cheese is melted and the sauce is bubbling, about 20 minutes. Serve hot or warm.