I have set the option requireHM=true in my pixelmon.hocon config file on Pixelmon version 8.2.0, and while this does work to prevent swimming with water pixelmon across all generations (at least any I've tested so far, I only tried to get at least 1 or 2 from each generation to try after finding this bug, and they wouldn't properly swim without Surf so that is fine), it doesn't apply properly to all flying Pixelmon.
It seems that all generation 1 flying Pixelmon (for example Charizard, Fearow, Pidgeot, etc) are still able to fly around without knowing the move fly, while any other flying pixelmon from other generations (Generation 2+ like Noctowl, Staraptor, Yveltal, etc) are not able to fly at all unless they are taught the move fly. I believe this bug may be tied to how Gen1 pixelmon were given a new flying mechanic for testing, and that new flying mechanic probably isn't registering that config change to require HM.
Tl;dr -
Set 'requireHM=true' in config (saved and restarted)
Gen 1 flying pixelmon can fly even if they don't have the move fly.
Gen 2+ flying pixelmon cannot fly unless they have the move fly.
https://pixelmonmod.com/tracker.php?p=2&t=15725 - There was a previous post about this back in May of 2021, however it didn't have any updates or changes away from a 'new' status so after talking to Lord_Samosa in the discord, they advised to submit a new bug report about this issue.
Mod List: (Got an SQL Error regarding too many characters in the field so pasting here) -
BiomesOPlenty 7.0.1.2444
BOP Patch 1.0
Chameleon 1.12 4.1.3
DynamicTrees 0.9.24
DynamicTreesBOP 1.5.1
forgeessentials 12.3.117
Gameshark 6.0.4
jei 4.16.1.302
NaturesCompass 1.8.5
OreRegen-MC v1.0.1
PixelExtras 2.5.12
PixelmonInformation 8.2.0 0.3.9
SoftBlocks 1.0
StorageDrawers 5.4.2
StorageDrawersExtras 3.1.0
TravelersBackpack 1.0.35