You can spin up a 3 phase permanent magnet motor and use it as a generator. Most inverters will do this on their own and no disconnect is needed - a small amount of overspeed will push power back into the battery.
Your challenge is having it operate at its maximum power transfer point, which likely needs some bespoke circuitry and software, unlike what we do here by commanding torque/regeneration with a throttle pedal.