You were not able to trade in 5th gen until you received the C-Gear/Pal Pad which required beating the first gym, receiving HM01, and rescuing Musharna.
All of this still counts as getting to trade after the first gym badge because rescuing the pokemon and getting cut and everything are all small side quests which you have to complete so you can get the c-gear and unlock the trading feature.
All of this still counts as getting to trade after the first gym badge because rescuing the pokemon and getting cut and everything are all small side quests which you have to complete so you can get the c-gear and unlock the trading feature.