Create a SharePoint Designer workflow that would be kicked when a new item is added to the list. Select the list and 1) Select the Action as Set field in current item 2) Click the field to select ListId and set the value to ID. ...
Microsoft SharePoint Full Article Link - Getting List Item ID in InfoPath Form