We know that publishing site cannot be saved as a template. Even if you start with a team site template, the moment you activate the publishing feature you lose this capability.

Once activated, you can get this functionality back just by deactivating the feature.

 However, there is a way out:

  • Open the site in SharePoint Designer
  • Go to Site Options
  • Edit the key SaveSiteAsTemplate
  • Make it to true from false.

Watch it working with examples in the video below step by step:

Hope this will help you out.