The chances of the trains you will want to take being sold out are next to zero so you will have no trouble buying tickets when you get to Florence. However, if you book a ticket now on the Swiss Rail site for Milan-Basel, you can get a discount fare for that leg. Here are two examples:
Take a EuroStar Italia train from Florence to Milan, departing at 07:00 and arriving at 08:45. The 2nd class fare is €52.00. Leave Milan at 09:10, connect in Arth-Goldau, and arrive in Basel at 13:53. The standard 2nd class fare is 118.20 CHF, but the cheapest discount fare is 68.20 CHF.
Take a EuroStar Italia train from Florence to Milan, departing at 09:00 and arriving at 10:45. Same fare as in #1. Leave Milan on a direct train to Basel, departing at 11:20 and arriving at 15:32. The standard 2nd class fare is 117.00 CHF, but the cheapest discount fare is 30.00 CHF.
If you will arrive in Italy at least seven days before you depart from Florence, go to a station immediately and see if you can get a Meno 15 fare (15% discount) for Florence-Milan. Meno 30 fares (30% discount) are possible for tickets bought at least fifteen days in advance. The number of tickets for each offer is limited. These offers apply to EuroStar Italia and IC trains, but not to regional trains.