I'm not sure you can. If you look at the doco for variables you'll see you can't set the keys in the yaml file using variables.
Note: You can only use variables in serverless.yml property values, not property keys. So you can't use variables to generate dynamic logical IDs in the custom resources section for example.
I think it's the same for all providers but I've linked to the AWS one.
You should be able to change the path though, because that is a value, not a key.
Taking a step back though, why do you want to do this? It seems to break the usual tradition of building a single artifact and promoting it up through your environments. If you change things when it goes to production, you haven't really tested what is being deployed in your CI environment.