First, enable real-time carrier calculated rates on Shopify's end. You can do that if you're a Shopify Advanced plan user. You're also able to use this feature for other Shopify plans by contacting Shopify and requesting they add live rates for an extra $20 per month.
Second, connect your Shopify live rates feature to Printful. Go to your Printful Dashboard > Settings > Shipping and choose your Shopify store. Under the Enable live shipping rates for Printful products with Shopify heading, click the checkbox next to Use live rates for my Printful products. And you've connected your Shopify's live rates to Printful!
If your store has products you store at Printful's warehouses or products you fulfill elsewhere, you have to add shipping costs for those products separately on Shopify's end.
In cases where your customer has both Printful and non-Printful products in their cart, Shopify will automatically take the lowest available shipping rate from both product groups and combine them together into one. So your customer will see one shipping option available at the checkout.
If you wish to create more advanced shipping rate combinations, there are some paid apps like Advanced Shipping Rules that will allow you to do that.