Hmmm, the Imperials do need a cook and there are plenty of bounty hunters on the Flying L willing to do anything as long as they get paid.
@Jayhawk_Greencape, spies are difficult to write, unless you think you're up to the task. Besides, who would you be spying for? The Resistance barely knows that this particular anti-piracy unit has been established, much less that they're flying around in a miserable rust-bucket.
What would fit better is that the Imperial team is approached by a bounty hunter offering his services in their endeavor. During the negotiations, he lets slip that he also knows how to cook. The relieved Imperials take him aboard and install him in their kitchen. The disgruntled bounty hunter retaliates with a "You'll eat it and you'll like it or you'll starve." attitude.
Besides, it would be hilarious if the cook fights pirates with a "Don't look at me. I'm just here for the paycheck." sort of expression that causes the pirates to leave him alone.
However, if you still want to be a spy.....
You can wait until after our first encounter and sneak away in the ship's emergency craft. You manage to track down the pirate ship, no small feat, and make an offer. You will relay information to us in exchange for......I'll let you figure this out.
When we ask why you are doing this, you say that they disappointed you. Instead of giving you a position of authority and command of automatons, they made you the cook and feel entitled to boss you around. You say that if you had wanted to work in a small, greasy kitchen; you would have consulted the Help Wanted sign hanging in the canteen.
Many bounty hunters have a signature something that makes them stand out from the ordinary rabble. What would yours be?