Use the following expression for the rotation value:
90 - azimuth(
point_n( $geometry, 1),
point_n( $geometry, 2)
) / 3.1415927 * 180
This expression gets the angle of the line between the first two points of the polygon, then converts from clockwise radians to counterclockwise degrees that are used by the rotation option.