This all depends on how these networks are connected. If there is no direct BGP connection between A and B, this would never work.
Your assumptions on what 'peering' and 'transit' are, are a bit off I think. Mostly, these concepts refer to the financial relationship between networks. 'peering' usually means it's settlement-free, while 'transit' is paid. What routes are exchanged can differ for both types. 'paid peering' (where one network receives routes from another network and its downstream networks) and 'partial transit' (where a network receives a specific subset of the routes in the global routing table) are two other variants of relationships between two networks.
In this specific case:
Network B could decide to announce C and D's prefixes to A, and A can choose to accept them. But there's usually no real motivation to do so. Network B would allow traffic from another to another network to flow through their network, consuming resources and capacity, without any financial compensation. So B could ask A to pay for receiving the routes and transporting the traffic to C and D, making it a form of partial transit.