[xla-auto-sharding] Move implementation of CostGraph methods to .cc file.
[xla-auto-sharding] Move implementation of CostGraph methods to .cc file.

Notes:
- Create auto_sharding_cost_graph.cc and move CostGraph implementations there.
- Make ToString() a const method.
- Make most pass-by-value arguments const.
- Add TODO to make class members private.
