The gemara (Betzah 17a) quotes a beraita with Rava's ruling at the end:
תנו רבנן אין אופין מיום טוב לחברו באמת אמרו ממלאה אשה כל הקדרה בשר אע"פ שאינה צריכה אלא לחתיכה אחת... ר' שמעון בן אלעזר אומר ממלאה אשה כל התנור פת מפני שהפת נאפת יפה בזמן שהתנור מלא אמר רבא הלכה כרבי שמעון בן אלעזר
Trans. with Steinzalts commentary:
The Sages taught in a baraita: One may not bake bread on one Festival day for the next, i.e., on the first Festival day for the second Festival day kept in the Diaspora. Nevertheless, actually, they said the following established halakha: A woman may fill an entire pot with meat to cook on a Festival, although she requires only one piece for that day, and all the remainder will be for the following day... Rabbi Shimon ben Elazar says: A woman may fill the entire oven with bread, although she does not intend to use it all on that day, because bread bakes well when the oven is full. A full oven has less empty space and is therefore hotter; consequently, filling the oven with bread serves not only to provide bread for the next day but also to improve the bread to be eaten that same day. Rava said: The halakha is in accordance with the opinion of Rabbi Shimon ben Elazar.
Following the unanimous agreement among medieval rabbis, the Shulchan Aruch (OC 503:1) codifies as follows:
אסור לאפות או לבשל או לשחוט ביום טוב לצורך מחר... אבל ממלאה אשה קדרה בשר אף על פי שאינה צריכה אלא לחתיכה אחת
Based on this, it would be permitted for one to prepare, e.g., a pot of rice which only partial would be for consumption on the holiday (since food comes out tastier when prepared in larger units; cf. Bet Yosef op. cit.). More so, Rema goes further and states:
וכן יכולה לבשל הרבה קדרות ולאכול מכל אחת מעט
Meaning, if one were to prepare separate pots of rice (for example), intending to have them for after holiday*, in which case it is recognizable that the multiple pots are not for the current meal, as long as something of each pot is consumed now it would be permissible.
However, all agree that it is prohibited -in the first place- to prepare food for another time after having completed one's meal and taste from the newly prepared. For example, if one does not need (any longer) rice for his holiday meal and needs it only for afterwards so in order to take advantage of this legal subterfuge he eats some rice - this is what's called "הערמה" (artifice) and is prohibited, as further codified by SA (ibid.):
ודוקא קודם אכילה אבל אחר אכילה אינה יכולה לבשל ולומר אוכל ממנה כזית דהוי הערמה מיהו אם עברה ובשלה (או שחטה) מותר לאוכלו
Whether or not it is permissible for one to explicitly say that some of the food is intentionally being prepared for after the holiday is a matter of dispute, cf. Bet Yosef (ibid.).
*R. Ovadiah Yosef (Chazon Ovadiah on Yom Tov pg. 38) cites this ruling and draws no differentiation between preparing for second day of holiday or for after holiday.