This will depend on what keyboard you are using: your manufacturer's default (which will depend on which manufacturer) or a replacement you have installed yourself. And then depending on the keyboard app this may or may not be possible. Look in the keyboard's settings to see whether it has any option to export data.
However, most keyboard apps don't have any option to export data, and to manually copy the database will require rooting the phone (which will erase the data in the process). Some might let you link your learned suggestions to an account, so that when you sign into the same account from another phone you could use them (this of course also means that the company would have access to these data). So have a look in the app's settings, have a look in your internal storage for any folder that looks like it comes from the keyboard, and have a look in android/data to see whether you can (a) find a folder for your keyboard there and (b) access anything from it. But no promises that this will be possible.
If you are using your manufacturer's default keyboard you should also bear in mind that if the new phone uses a different keyboard it won't be able to read data from your current one - this stuff will all be app-specific.