I remember reading this book when I was a kid. I think it was book 2, so a lot didn't make sense to me at the time. I suddenly remembered it recently and really wanted to know what it was.
The first scene is the main characters teleporting onto a planet full of a spider aliens who try to make them fall asleep by feeding them so the spider aliens can eat them. The main characters then try teleporting away, but the spider aliens somehow made it so they teleport back to the planet with their memory wiped so they thought it was the first time they arrived there. The only reason they were able to escape was because they had an irritable AI with them that didn't get memory wiped.
They also 2 shapeshifting aliens with them, one stuck in a dog form and the other stuck in a cat form because of some event in book 1. The main characters eventually reach another planet with shapeshifters, and the shapeshifters with the main characters suddenly gain their powers back and help the main characters fight back. I remember them shifting into a two tailed weasel, to fight. Then the opposing shapeshifters turned into flying turtles that flew really high and then fell down to crush them, so the cat turned into a giant tree. Then they transformed into insects that could accelerate fast enough to punch through anything the cat could turn into. The cat turned back into a cat and told them that they were going to die. As the insects came flying towards them, on of the humans who was possessed in book 1 by an evil alien suddenly transformed into a gelatinous ball and stopped the insects, and the other humans were worried because that signified that he was still under mind control or something.