How to script a table with dynamic data masking via SSMS
You can use Powershell and SMO.

Create a new folder ('Scripts') on your C-Drive for use in the following example

In SSMS, right-click on the 'Tables' node and select 'Start Powershell'.  Paste the following code into the Powershell window

Remove-Item C:\scripts\z.sql
$scriptingOptions = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions
#$scriptingOptions.ScriptDrops = $true
$scriptingOptions.NoCollation=$True;
$scriptingOptions.ScriptBatchTerminator = $true
$scriptingOptions.NoCommandTerminator=$false
$ScriptingOptions.FileName = "C:\scripts\z.sql"
$ScriptingOptions.ToFileOnly=$true
$ScriptingOptions.AppendToFile=$true
dir | Where-Object {$_.name -like "*test*"} | foreach {$_.Script($scriptingOptions)}


Check for the z.sql file in the C:\Scripts folder

If it's any consolation - I too cannot get SSMS to natively script the masking details and I'm on the latest release.