Use caseCreate an issue after transitioning an epic and update its Epic Link field to link it to the transitioned epic.
Add a Create issue post function to the desired workflow transition.
The Create transition might be here the best choice. When added to the Create transition, the post function will be automatically executed each time that an issue is created.
Issues to be created
Choose Single issue
Choose Selected issue type → Task
Enter any expression that suits your needs.
Choose the Epic Link field.
Select Select field value manually (parser expression).
Write the following expression with the expression editor in Basic text mode.
If the transitioned issue is an issue under the epic instead of the epic itself, you could use this expression in Advanced text mode to inherit the Epic Link field value.
Use the following expression.
This expression evaluates if the issue type of the issue that executes the transition is Epic. If it is needed that other issues with different issue types execute the post function, the expression for the conditional execution should be adjusted.