There are quite a few tools available for visualising dependency trees (debtree and apt-cache can do it fi).
ros-melodic-cpp-common indeed brings in approx 580 MB of dependencies (when installed on a bare ubuntu:bionic). libboost-all-dev is essentially almost singularly responsible for this (207 pkgs for libboost-all-dev vs 210 pkgs for ros-melodic-cpp-common).
ros-melodic-roscpp already lists very specific parts of Boost as dependencies, but as it depends on cpp-common (as @Will_Gardner wrote), installing just roscpp on a bare ubuntu:bionic image wants to install 655 MB of packages.
Of this only 8.1 MB is actually placed inside /opt/ros/melodic.
Edit: @Will_Gardner: I imagine you have some way of figuring out the runtime dependencies of particular ROS nodes / packages and then generate metapackages based on that information. Have you automated this, is this a manual process, or are you relying on package manifests?