How to migrate clssic pages in a non-site page library to a modern user interface in SharePoint Onine

string siteUrl = "https://contoso.sharepoint.com/sites/mytestsite";
string targetSiteUrl = "https://contoso.sharepoint.com/sites/mytargetsite";
string userName = "joe@contoso.onmicrosoft.com";
AuthenticationManager am = new AuthenticationManager ();
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant (siteUrl, userName, GetSecureString ("Password")))
{
using (var ccTarget = cc.Clone (targetSiteUrl))
{
var pageTransformator = new PageTransformator (cc, ccTarget);
var pages = cc.Web.GetPages ();
foreach (var page to pages)
{
PageTransformationInformation pti = new PageTransformationInformation (page)
{
// If the target page exists, then overwrite it
Crush = true,
};

try
{
Console.WriteLine ($ "transformation page {page.FieldValues["FileLeafRef"]} ");
pageTransformator.Transform (pti);
}
catch (ArgumentException ex)
{
Console.WriteLine ($ "Page {page.FieldValues["FileLeafRef"]} could not be transformed: {ex.Message} ");
}
}
}
}

the code above is provided by Microsoft to turn classic pages into a modern user interface, but it is configured by default to allow only the page library.

Can any one suggest there are other options for managing custom site pages or pages of other libraries?

reference to the microsoft documentation: Classic Transformation in a Modern User Interface via a .Net Solution