$query = "SELECT * FROM products_related JOIN products ON products.id = products_related.related_id WHERE products_related.product_id = 2";
//$relatedss = RelatedAssignment::find()
->select('*')
->leftJoin('products', '`products.id` = `products_related`.`related_id`')
->where(['products_related.product_id' => 1])
->all();
RelatedAssignment::find()->andWhere(['products_related.product_id' => 1])
->with(['products']) // опционально, читайте про жадную загрузку
->all();