If you would like to save the ID without requiring code to do so, the Gravity Flow Outgoing Webhook provides a response mapping feature as a part of defining the step settings. See this reply on a related topic that shows more about the setup. In your case, your merge tag would then just need to know the Entry ID and Field ID from form 1 where the ID is stored to be used in the webhook settings for step in Form 2.
If you wanted to go further and have the ID in Form 1 deleted after Form 2 executes its’ webhook successfully, the Form Connector extension has a step type for Update an Entry that offers similar no-code pattern to set the value of ID field in Form 1 to empty.
Cheers,
Jamie