Generally expiration dates set by producers are determined using microbial activity tests and measured against some acceptable threshold for the product. Microbial activity is essentially the number of microbes (bacteria, yeast, mold, etc.) growing on or in some food. There's no hard rule for saying that some set level of microbial activity will make you sick, but the risk of illness caused by harmful microbes increases as the overall count of microbes rises. So the expiration date is not a magical date upon which the food is definitively spoiled - it's an estimate of when the food will reach a somewhat-arbitrary amount of microbial activity that's considered unacceptably risky to eat by the producer in question.
Cooking is a form of pasteurization, and it will kill most of the microbes present in the food, so you could consider this a means of "resetting" the microbial activity in the food. However, that has some important caveats:
- Cooking does not remove toxins produced by some harmful microbes that can make you sick; if there's a risk that those were present in the uncooked food, then the same risk applies to the cooked food.
- Cooking damages cell walls and accelerates degradation of the cooked food, causing it to spoil more quickly; the general rule of thumb for cooked foods is about 3-4 days in the fridge. Basically, once you cook a food it's no longer the same product, and the expiration date no longer applies the same way that it did to the uncooked food.
So, like many food safety questions, this is not a question with a single "right" answer - it's a calculation of the risk that the food could make you sick. There is always some slight risk, and there are many other factors besides the food and its expiration date, such as how you stored the food, whether you (or whoever you're feeding) has an immune deficiency that makes them more likely to get sick in general, etc. When you ask "has a food gone bad?" that must be interpreted and answered as a question of "has this food exceeded an unacceptable risk for consumption?" in food safety terms.
Personally, if I felt confident in the safety of all of the ingredients that were expiring, I wouldn't have qualms about a cooked product made from them lasting for another day or two. But, if any of those ingredients were suspect, then they should be thrown out and not used; a dish cooked from them would inherit the same risk as the original ingredients.
This goes doubly for any commercial situation where you are selling the food to someone else; in that case there are specific regulations set by government agencies around the acceptable level of risk.