Setting up a new DHT independent of Freeworld

Yes that can be done.
The YaCy network is defined in the YaCy network definition file. For the ‘freeworld’ network this is in defaults/yacy.network.freeworld.unit.
Just have a look at the different ‘yacy.network.xxx’-files in defaults.
The network is selected by setting the attribute network.unit.definition in defaults/yacy.init to your network file.

A network definition is simple: its just a combination of a name of the network together with a IP pattern that must apply for your network. For a start, do copy-paste of existing files.

There are some additional settings for the shape of the DHT and bootstraping seed lists. If you want to spawn up a peer-to-peer network you must solve a little bit a chicken-egg-problem: start with one peer, make that peer into a principal of that network and then assign your seedlist location to the bootstrap file list.

Please have a look into all mentioned files, there are plenty of comments which explain the attributes.