Use APFS VM Volume From Another Disk
I believe I've found a solution to this thanks to an answer to a similar question, the process that is responsible for the swap-files is /sbin/dynamic_pager, which is triggered by a launchd task found at /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist. Since this file is located in /System it means that this solution requires System Integrity Protection to be disabled, and for Catalina you will need to perform the changes from your recovery volume.

First step is to take a backup of the original plist:

cp /System/Library/com.apple.dynamic_pager.plist /System/Library/com.apple.dynamic_pager.plist.orig


Now we want to modify the command that is executed. In the original it will look like this:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;EnableTransactions&lt;/key&gt;
        &lt;true/&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;com.apple.dynamic_pager&lt;/string&gt;
        &lt;key&gt;KeepAlive&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;SuccessfulExit&lt;/key&gt;
                &lt;false/&gt;
        &lt;/dict&gt;
        &lt;key&gt;POSIXSpawnType&lt;/key&gt;
        &lt;string&gt;Interactive&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;/sbin/dynamic_pager&lt;/string&gt;
        &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;


I modified my ProgramArguments section to the following:

        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;/bin/bash&lt;/string&gt;
                &lt;string&gt;-c&lt;/string&gt;
                &lt;string&gt;diskutil mount -mountPoint /private/var/vm disk1s4 &amp;amp;&amp;amp; /sbin/dynamic_pager -F /private/var/vm/swapfile&lt;/string&gt;
        &lt;/array&gt;


This now runs two commands, the first to mount the internal VM volume at /private/var/vm and the second is a modified call to dynamic_pager telling it to create swapfiles at the new location.

NOTE: In my case the VM volume was disk1s4, and while this should be the case for most systems, you should double check with diskutil list first and modify the new command accordingly.

To activate the changes, either restart or, if you're sure you aren't using a swap-file at the moment, you can unload and reload the launchd task immediately:

launchctl unload /System/Library/com.apple.dynamic_pager.plist
launchctl load /System/Library/com.apple.dynamic_pager.plist


The new swapfile location should now be set, and if necessary you can remove any leftover swapfile(s) (in my case at /vm).

UPDATE: Simpler method

It occurred to me that there may be a simpler solution to this problem; since the dynamic pager launchd task doesn't supply a specific location for swapfiles, it seems it will choose in order of preference, with /private/var/vm being preferred if available. To this end it may be possible to force the use of the internal drive's VM volume like so:


Get the VM volume's UUID (diskutil info disk1s4)
Run sudo vifs
Add a line like so: UUID=9e2cd41c-1566-11ea-9237-ef9cfb4e0fac       /private/var/vm  apfs    rw,nobrowse,union swapping in your volume's UUID


This should cause your system to automatically mount your VM volume at /private/var/vm, and since this will occur before the dynamic pager runs, it should see and select this location, with no need to disable SIP or edit its launch daemon.