This kind of connector (fairly sure you can get them with in-line hose adaptor bits also) - screws straight onto the connection on the trap. Then hose the correct diameter?
Unless anyone else has a better suggestion, of course (or I've linked the wrong thing).
https://www.screwfix.com/p/floplast-hose-connector-40mm/48625?tc=PB3&ds_kid=92700055281954514&ds_rl=1249404&gclid=EAIaIQobChMIv-yRg87X-AIVkZftCh3lEgoBEAQYASABEgJd6fD_BwE&gclsrc=aw.ds
This kind of connector (fairly sure you can get them with in-line hose adaptor bits also) - screws straight onto the connection on the trap. Then hose the correct diameter?
Unless anyone else has a better suggestion, of course (or I've linked the wrong thing).
Or these:
https://www.stevensonplumbing.co.uk/washing-machine-waste-pipe-connector-nozzle-straight.html