If you are the primary person putting together the manuscript, then you can always send your PI a list of contributors to the project, yourself included, and ask them for their preferred authorship order.
I think it's okay to just ask what you need to contribute to a paper for authorship whenever you work with someone new. Some labs are very strict and others are more generous, it can be hard to predict.
I wouldn't ask this question to any PI directly. I like the response above from Shirafune. It's kind of like a passive way of including yourself but ultimately giving your PI the final say in who is in or out.