If you're trying to farm SP for a level 40 5☆ character, then the only way to get SP outside of merging allies together (which would require another of that unit -- likely not an option if they are a rare character, e.g. Hector or Azura) is to get it from kills.
At launch, your options were very limited in that you could really only farm SP in Arena battles or the Training Tower. However, thanks to numerous updates, there are some great (less grindy-feeling) ways to earn SP much faster than before:
Utilizing double SP events pays off very quickly. Assuming you have a unit sweep a team within the level range to award SP, a hero can get between 18 and 30 SP from a single battle as opposed to 9 to 15.
- Sword/Lance/Axe/Tome Valor skills
This goes along with the previous bullet point. The Valor skills (Sword Valor on Gray, Lance Valor on Summer Robin, Axe Valor on Summer Tiki, G Tome Valor on Summer Elise) will allow all units wielding the corresponding weapon type to receive double SP in a battle that a hero with that skill equipped is on the same team for. This actually compounds with double SP events, which means a hero finishing off four enemies will earn 48 SP in a single map. This is by far the most effective method of grinding SP in a short amount of time.
While the units that can benefit from these the most are limited to 8 per Trial period (the 8 focus units receive double SP and EXP when participating, as well as stat boosts that make them extremely effective), this is a very viable way to farm SP. Even if you want to farm SP for a hero who isn't a focus unit, if you attempt to get all of the rewards, the team you use for the Trials will gain a ridiculous amount of SP. In the current Tempest Trial Mini, I started using my newly-created Super Camilla+4. Despite barely having enough SP for all of her skills going into these Trials, she's now sitting at nearly 5000 SP, which is far more than she will ever need.
For posterity, the original two efficient ways to earn SP are below:
Assuming the heroes you fight are also level 40, your maxed heroes will get some SP from these. As an added bonus, these would also end up netting you some Feathers to unlock the potential of other units.
This used to be the most Stamina-conservative way to farm SP aside from Arena battles (since they don't cost Stamina), since story missions take an absurd amount of Stamina to attempt at higher levels, while this takes 9. However, thanks to the addition of new game modes and mechanics, the Training Tower is not nearly as effective as it once was.