This can be solved in the same way other applications that can save to multiple formats solve it: if you only use the functionality the target format supports, saving works transparently (so, e.g., you can create an image, draw an arrow and save it as a PNG). If you try to use functionality that the target format doesn't support (e.g. layers on PNG) then GIMP should display a warning dialog about it, perhaps with an option to save as a XCF instead (but not default on it).
This has two additional benefits: 1. the beginner will stop be a beginner at some point, will be informed about the target format they are trying to use and will know how to save, save as, etc so this issue will stop be a problem for them and 2. it will get rid of the useless and annoying "do you want to save" warning whenever you want to create a non-XCF image file (because you already saved with "Export", you just didn't save the image as an XCF).
The current approach makes the (wrong) assumption that everyone works with XCF files and only exports to other formats. This might be true for some cases, but a lot of people want to work with other formats directly.