create a list template in sharepoint online code example
Example: save list as template sharepoint online modern site
Import-Module Microsoft.Online.SharePoint.Powershell
$tenantName = "Yourtenantname"
$SiteURL ="https://$($tenantName).sharepoint.com/sites/TSInfoModernSite"
Connect-SPOService -Url "https://$($tenantName)-admin.sharepoint.com"
Set-SPOsite $SiteURL -DenyAddAndCustomizePages 0