I haven't been able to find a way to get the package object directly from the graph object.
You can, however, iterate through all the packages and see if the URL of your graph matches the URL of child resources in each package:
def find_package_of_graph(self, graph):
for pkg in self.context.getSDApplication().getPackageMgr().getUserPackages():
if pkg.findResourceFromUrl(graph.getUrl()):
return pkg