I'm on Android 9 (Pie), and the names of the options seem to have changed a bit but the beginning is the same:
1) Press one of the volume buttons.
2) Tap the settings icon on the menu that shows the volume.
3) At the bottom of the screen open the Advanced section
4) Turn off charging sounds.