Get's the ComponentDefinition of the ComponentInstance or Group
definition = self.get_definition(entity)
Get's the bounds of the definition - note that if you get the bounds of the instance it will be a Boundingbox aligned to the model axis - not the instance axis. Which is why you need to get the definition bounds.
bb = definition.bounds
Now transform the points of the definition boundingbox with the transformation of the instance.
pts = self.bound_points(bb).map { |pt| pt.transform( entity.transformation )
In other words, get the boundingbox of the definition and apply the instance transformation to the coordinates of that boundingbox.