Yes you can save cooked spaghetti squash in the refrigerator for up to 5 days.
Just be sure to cover the cooked spaghetti squash when refrigerating it to keep the other food odors out of the spaghetti squash.
If you want to keep the cooked spaghetti squash longer than 5 days you can put the spaghetti squash in a freezer safe container and then freeze it.
When you freeze the spaghetti squash it will last for up to a year and sometimes longer but it loses it's freshness after a few months.
I sometimes will cook spaghetti squash and have the leftovers frozen for up to a year and it's still okay and safe to eat.
It just loses it's freshness but it's perfectly okay to eat.