When objects rotate, the AABB has to be recalculated (Axis Aligned Bounding Box — an axis-aligned bounding rectangle). The obvious simple idea is to take the 8 vertices and rotate them. But that turns out to be a rather expensive approach. We'd have to compute the coordinates of the vertices themselves and their coordinates after the transformation, and only then find the minimum and maximum values. The optimal solution:
function transformAABB(bbox, matrix)
{
	var min_x = matrix.axisX * bbox.min.x;
	var max_x = matrix.axisX * bbox.max.x;

	var min_y = matrix.axisY * bbox.min.y;
	var max_y = matrix.axisY * bbox.max.y;

	var min_z = matrix.axisZ * bbox.min.z;
	var max_z = matrix.axisZ * bbox.max.z;

	var pos = matrix.getPosition();

	return [
		vec3.min(min_x, max_x) + vec3.min(min_y, max_y) + vec3.min(min_z, max_z) + pos,
		vec3.max(min_x, max_x) + vec3.max(min_y, max_y) + vec3.max(min_z, max_z) + pos
	];
}
Of course, there are other ways to compute an AABB quickly after transforming an object, but this one turned out to be among the fastest and simplest.