You can use the route resolver with Content Relationship fields.
Firstly, you would need to create a custom type for your "mother page" and another custom type for your "child page". In the "mother page" custom type, you can create a Content Relationship field that links to the "child page" custom type.
In your Next.js project, if your "mother page" has a UID of "generation-xyz", and your "child page" has a UID of "apple", the URL would be "/generation-xyz/apple". You can use the route resolver to map this URL to the appropriate page template and fetch the data for that page from Prismic.
This use case is not explicitly covered in the Prismic documentation, but it is a common pattern for creating nested dynamic routes with Content Relationship fields.
At this time, we don't have a sample replicating for such usage. However, I can add your request as a suggestion for future updates to our example project.