Can't animate transform and manipulate it in code as well?

I’m doing a simple game in 2D. I have the player controlling a ship in the middle that can only move in a circle, kind of like Super Hexagon. The player shoots bullets outwards at enemies. In order to know where it’ll fire, it’s rotated to face out of the centre of the circle, which I do by setting the rotation in the update code:

protected virtual void Update()
{
	Angle -= StrafeVelocity * MaxStrafeVelocity;

	transform.position = MathsUtils.GetCoordinateOnCircle(Vector2.zero, Radius, Angle);
	transform.rotation = MathsUtils.GetOrientationInDirectionOfMovement(MathsUtils.GetPerpendicular(transform.position));
}

I wanted the player to wobble a bit when hit by an enemy bullet, and figured I could do this easily in an animation (where I also change the colour of the ship). But adding a rotation curve and at least one keyframe seems to prevent the ship from being rotated from the code I just mentioned; it always faces up instead. If I enable ‘animate physics’ in the Animator, it seems to allow the rotation from the code, but the wobble from the animation doesn’t happen.

I’ve been trying stuff out but I can’t seem to wrap my head around this. I only first used the animation tools a couple of days ago so I may be simply missing something. How can I manipulate the transform both in the code and in the animation?

So the reason was that the animations are all happening in world space. In order to get it to happen locally I needed to nest the object under a parent GameObject. Doing that and shuffling stuff around so the right scripts/etc were being called solved everything.